Nilayan
Nilayan

Reputation: 15

share Phonegap storage database between two android apps

Is there a way by which two different android apps could share the same database using the Phonegap Storage API (http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#SQLTransaction); while searching i came across android share id and content providers but dont know how to implement them in phonegap with the database api mentioned above. specifically how can i get an instance of the database created by the host app in the client app ?

Upvotes: 1

Views: 999

Answers (2)

Dunc
Dunc

Reputation: 18932

Two potential options:

  1. Specify a shared user id in both apps, then access the database from the second app with the context of the db hosting app - details here (would require you to write some Java / Cordova plugin)

  2. Use a ContentProvider (details) to make data available from one app to others. Again, some Java / Plugin code necessary.

Upvotes: 0

Kevin S
Kevin S

Reputation: 1077

Using Phongap / Cordova I can't think of a way this would be possible. However my suggestion to get round this problem would be to use online storage and access that storage from both apps. There are services out there that offer this service for you if you don't have the know how to do it yourself. Try https://www.parse.com/

Good luck!

Upvotes: 1

Related Questions