Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!

Pol Denais

+ Follow
since Apr 07, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pol Denais

Hi Prasad,
Thats just at the stage where I am at now, wondering how to pick one value from the XML file. so this is where I need to improve:

BufferedReader reader1 = new BufferedReader(new InputStreamReader(content));
       String line1;
       StringBuffer buffer = new StringBuffer();
       try {
           while ((line1 = reader1.readLine()) != null) {
2 years ago
Ok so far I can read the value of the shared file by using the content uri: content://com.application1/shared_prefs/application1_conf.xml. Manually this pulls back the details of the XML file. Now I need some help below on my code below to read the file and pick out one value only. I don't want all the values in the Xml, just one. I then need to return this to the calling function.

appreciate any help

2 years ago
Hi All,
So Im trying to solve a problem and I was previously posting on this trying to code a certain solution but I think I went up the wrong path and Android wouldn't let me access the file.

In my Android application, I'm trying to read the value stored in the shared_prefs folder of another application. That application exports a content provider.

Anyone any idea what way to code this.

2 years ago
Thanks Prasad, Yeah I think I'm looking at the wrong idea. Could be I need to look at content provider to read this value.
2 years ago
Thought I could try this instead below in an easier way but pin is showing null :

2 years ago
why is the mFile value


Should it not be :

2 years ago

Still no joy. It finds the package name now but still returns null

2 years ago
Ok I put in Log.i("mainActivity", "My key is " + key);

and when I debug I can see, key is "Couldn't find"
2 years ago
Ok so the code in Application 1 uses the following:

In my application I was using the following code:

Thanks in advance
2 years ago
Thanks Prasad, Im just trying to debug it as my code is showing no value returned and when I debug, I can see a path location for my own application, in that its looking for application1_conf.xml under my own app's folder:


I thought it should be looking for:

2 years ago
Thanks Prasad,

When application 2 is reading from Application 1's shared pref file (XML), how does it know what location to look ? Application 1s shared pref files sits under its folder on the device.

2 years ago
HI All,
My Android app needs to read a value from an XML file stored in shared_prefs under another app and store it in a parameter in my apps code. So I have the path to the file but I don't know how to code it:

the XML file is like:

2 years ago
Hi Stephan,
Thanks I went back through it all and I have it sorted now looking at bits of code online.

Thanks alot for you help on this and giving me pointers.

Greatly appreciated.

2 years ago

Pol Denais wrote:OK changed this code around: SORRY STILL NOT WORKING: doing something really stupid here now.

2 years ago
OK changed this code around:

2 years ago