File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 3950
    
  17

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: 3950
    
  17

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
Initializing variables
Code meets the question requirements?
StringTokenizer only receiving 4 tokens from a list of 9 tokens
Uploading a file other than an image.
Make methods