my dog learned polymorphism*
The moose likes Android and the fly likes SharedPreferences problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "SharedPreferences problem" Watch "SharedPreferences problem" New topic
Author

SharedPreferences problem

Naishadh Parmar
Ranch Hand

Joined: Jun 02, 2011
Posts: 95



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: 4168
    
  21

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: 95


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

Joined: Jan 28, 2003
Posts: 4168
    
  21

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://aspose.com/file-tools
 
subject: SharedPreferences problem
 
Similar Threads
Uploading a file other than an image.
Initializing variables
Make methods
Code meets the question requirements?
StringTokenizer only receiving 4 tokens from a list of 9 tokens