0

I have an requirement where I need to back up shared preferences data of the android library so that if the user reinstalls the application I can still get back the details. I know we have Android backup(https://developer.android.com/guide/topics/data/backup) which I think works for application but not for library.

Nikhil
  • 91
  • 1
  • 7
  • https://stackoverflow.com/a/6146207/3996989 check that out. copy that file (or upload it to a server) and retrieve it back when you want to. – Saba May 01 '18 at 18:01

1 Answers1

1

No, that isn't done at the library level. The installed application doesn't even know what libraries it uses, an installed app with libraries is identical to an installed app that had everything built in. The application that uses your library needs to do the backup.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • Is there any other means like iOS key chain which can access data even if you upgrade your phone or reinstall the application. – Nikhil May 01 '18 at 18:07
  • Nothing stays if you uninstall the app- on purpose. However if the client app is using android backup to back up his shared preferences, yours will be carried along with them. That should be sufficient. Unless you're trying to use this for some type of licensing, in which case you shouldn't trust the client to begin with and you should require an online check. – Gabe Sechan May 01 '18 at 18:10