Ok, that is what I was thinking might be the case. And that was a good point about the XML file. I had forgotten that the shared preferences were stored in an XML file. I will switch it to use an SQLite database.
When the docs say that the two programs are able to access each others data, what exactly does that mean? Does that mean just files and databases, or other things accessible as well? Thanks for the quick response! On Wed, Sep 30, 2009 at 6:01 AM, Mark Murphy <[email protected]>wrote: > > > According to the Dev Guide if two apps are signed by the same key and > > have the same sharedUserId set in the manifest, then they should be > > able to access each others data. > > > > I cannot get this to work. It should be possible for both apps to > > access the same shared preferences via > > PreferenceManager.getDefaultSharedPreferences(this), right? > > No, because "this" will point to two different applications, and they will > each get their local copy. > > One can use PreferenceManager.getDefaultSharedPreferences(this). The other > will need to construct a fully-qualified path to the other app's copy of > the SharedPreferences XML file and use some constructor or something on > SharedPreferences to access the data. Or, worst-case, it would need to > manually parse the XML. > > Since SharedPreferences are stored in XML and not in SQLite, I am very > very nervous about problems with sharing them between processes. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > Android App Developer Books: http://commonsware.com/books.html > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

