Csenteri Barna wrote: > Hi > > I would need to export the shared preferences and load it on another > device. Is this possible in a direct way somehow? (without exporting > the keys one by one and writing to a custom file) > > Another question is that there is any XML parser which has the same > functionality like SharedPreferences (getstring/addstring, getint/ > addaddint etc.) and saves/loads the result to a path anywhere? (sdcard > for example) > > I know SharedPreferences uses some xml's in the background but that > xml is not readable as a file without admin rights as far as I know so > it's not quite suitable for what I need.
AFAIK, you can read the SharedPreferences as an XML file. The dangerous part is that you will probably have to hand-assemble the path to the file, as I don't recall an API to get the path for a SharedPreferences file from the SharedPreferences object. Otherwise, there is no export mechanism available that I am aware of. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in NYC: 10-11 April 2010: http://guruloft.com -- You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

