1

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 ?

Nilayan
  • 15
  • 2

2 Answers2

1

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!

Kevin S
  • 1,067
  • 1
  • 10
  • 19
  • Thanks for your help, but my app needs to be an offline app due to limitations in connectivity available to end users. – Nilayan Apr 06 '14 at 17:58
  • Then it's perhaps not the answer you're hoping for - but it is the answer. You can't achieve this using Cordova / Phonegap. Sorry :( – Kevin S Apr 06 '14 at 18:49
0

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.

Community
  • 1
  • 1
Dunc
  • 18,404
  • 6
  • 86
  • 103