Code-Apprentice
Code-Apprentice

Reputation: 83527

Accessing database from two different apps

I am creating a Premium edition of an app for which I already released a free Lite edition. I want to either transfer the data from the Lite edition into the Premium edition or have both editions access the same database. Android, two apps one database? helped answer how to do the later. If the database is created in the Lite edition, what happens when the user installs the Premium edition? Do they have to keep the Lite edition installed in order to keep the data? On the other hand, can I create the database in a location that is independent of either edition but is still sandboxed? Ultimately, I want to be able to allow the user to remove the Lite edition after they install the Premium one but still keep all the data intact. How do I do this? Or am I stuck with making my users keep both editions installed even after they upgrade to the Premium edition?

Upvotes: 2

Views: 143

Answers (1)

ryan1234
ryan1234

Reputation: 7275

I would recommend at least looking into CouchDB for hosting the data. You create your data as documents (in JSON) and then you create databases that contain documents.

In addition you can create views on your data - http://wiki.apache.org/couchdb/HTTP_view_API. You can pass in parameters to the views to filter data etc.

You can create a sample CouchDB with Cloudant (https://cloudant.com/) or IrisCouch (http://www.iriscouch.com/). I know Cloudant supports HTTP authentication so you can make all your calls look like this from the Android device:

http://user:[email protected]/database

Another option is to look at TouchDB which handles replication from CouchDB for you. https://github.com/couchbaselabs/TouchDB-Android Keep in mind the project is a little behind right now, so I don't think it's production ready, but they're focusing heavily on it this year, so it should be coming along shortly.

Just an option for putting up a shared database with authentication. Then you could host the same data and leave the lite vs. premium stuff strictly in the UI.

Upvotes: 1

Related Questions