xur17
xur17

Reputation: 516

Android Access Another App's Database

I am creating an android application, and I want to directly access another application's database file (read from it). What's the best way to go about this, since applications are sandboxed from each other. I am okay with making the app require root permisisions, I am just unsure as to what the best way to do this is.

Should I make a copy of the database to my app's local area using the su command every time I start, and then use that database? Or should I directly access the database?

Upvotes: 1

Views: 2872

Answers (1)

slayton
slayton

Reputation: 20319

Are you developing both apps? If so then the the correct way to do this is to make use of ContentProviders If you aren't developing the app with the database check with its developer to see if it provides a ContentProvider.

If the app with the database you are trying to access doesn't provide an easy way to access its data then you can't do this without root, at which point you're problem has become many times more difficult.

Upvotes: 3

Related Questions