2

I want to know if the following is possible. I want to create a new Settings App in Android and then another App as well. I want both to use the same database and I do not want to use a content provider.

So I want to know if it would be possible to do this by storing the database on an external SD card? Are there any risks in doing this and can I access the database on the external storage from the Settings App?

Edit: So the other App that I refer to will query a server and get data that will be used to change settings in Android, but this information will be stored in an SQLite database. Then I want the Settings App to access this information and update the various things, so I need to simply know if both this Settings App and the other application will be able to access the SQLite database on external storage without any problems, so that I can achieve what I require? Hope this is a little more clear?

Thanks, Wihan

3
  • That's a good question but your question is a little general. please be more specific and ask about programming problems. ;) Commented Feb 10, 2015 at 11:53
  • I believe this is what you are searching stackoverflow.com/questions/7053809/… Commented Feb 10, 2015 at 11:56
  • @MDMalik yeah I saw that post, just wanted to make sure that this is possible from a Settings App since I have never written one and not sure if there are any limitations etc. Commented Feb 10, 2015 at 12:01

2 Answers 2

1

Yes, It is possible

Share database between two apps

But when the first app has been uninstalled, then the database will be deleted

For sharing database you need to add

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="my.app" ... >
Sign up to request clarification or add additional context in comments.

Comments

0

The database path is private for each application and as far as i know it's not possible to access it directly across applications.

However one approach is that one application makes it's database accessible to the other one using a ContentProvider. Check out if that works for you.

for more read: http://www.skholingua.com/android-basic/android-app-components/content-provider

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.