1

My first android app stores all data in an SQLite database and acts as a backend/admin panel. What I require is to have this data accessible(readable) by my 2nd android app.

Is it possible via Data Binding or Content Providers? If yes then how, please provides example code.

Looking forward to credible guidelines.

1
  • AIDL concept in android can help u achieve this Commented Feb 25, 2014 at 5:07

1 Answer 1

1

A ContentProvider is what you need.

It let's you define a SQL like interface to your data.
You can query, update, insert, delete data.
You can define, which permission scope is allowed to access the data and so on.

In most cases it's just a wrapper around your SQLiteDatabase.

A good example for a ContentProvider is the sms or contacts database, accessible via content://sms/... or similar UIRs.

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

Sign up to request clarification or add additional context in comments.

3 Comments

Can I use a ContentProvider for 2 different apps? Or I can just use it within a single app?
You can define the scope. In the AndroidManifest.xml is defined, if the ContentProvider is exported (accessible by other apps) or not. Additionally there is an permission model to make it more granular.
Correct! Done it with this excellent tutorial here: webcache.googleusercontent.com/search?q=cache:http://…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.