aspose file tools
The moose likes Android and the fly likes SharedPreferences problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "SharedPreferences problem" Watch "SharedPreferences problem" New topic
Author

SharedPreferences problem

Naishadh Parmar
Ranch Hand

Joined: Jun 02, 2011
Posts: 77



I have this code:



But I get this error:

Couldn't create directory for SharedPreferences file /data/data/org.quens.xno/shared_prefs/org.quens.xno.xml

I don't knwo what's the problem. I tried to look up on the net, but no results.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3036
    
    4

Is org.quens.xno the application you are writing? Because it looks like you don't have permissions to write in that context.


Steve
Naishadh Parmar
Ranch Hand

Joined: Jun 02, 2011
Posts: 77


No it is the package. This code is from the class org.quens.xno.MainActivity.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3036
    
    4

Hrm... are you testing in the emulator or on your real phone? What version of Android? There seemed to be a problem with Samsung in version 2.x that had this problem. Another thing to try would be to use the android adb tools to connect to the device and see if the file already exists - perhaps another app had created one with the same name?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: SharedPreferences problem
 
Similar Threads
Uploading a file other than an image.
Initializing variables
Code meets the question requirements?
Make methods
StringTokenizer only receiving 4 tokens from a list of 9 tokens