Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, two apps one database?

We are developing an android app and we want to make two versions, pro and free. The problem is that our apps use a database which we want to be available for both apps.Is it possible?

I mean, the client downloads the free app, and he uses it. Then he decides to buy the pro version, would it be posible to pass the data from free version to pro version?

Thanks

like image 283
seipey Avatar asked Feb 03 '12 15:02

seipey


2 Answers

Two different apps wont be sandboxed from each other and can use the same database provided that they are signed with the same private key and have the same sharedUserId. No need to store the database on a shared folder which might cause breach of sensitive data.

Add:

android:sharedUserId="com.yourprogram"

inside manifest tag in your manifest files and sign both apks with same key. For details:

http://developer.android.com/guide/topics/manifest/manifest-element.html

like image 101
Caner Avatar answered Oct 08 '22 14:10

Caner


you can use a content provider if you want

http://developer.android.com/guide/topics/providers/content-providers.html

like image 42
trembon Avatar answered Oct 08 '22 13:10

trembon