I’m having problems with the content provider. I’m trying to create a content provider.
public static final Uri CONTENT_URI =
Uri.parse("content://data/data/one.two/databases");
This leads to my database as I want to extract data from it and show it in the list view.
after which, I have to edit the manifest inserting the provider
<provider android:name="databases789"
android:grantUriPermissions="true"
android:enabled="true"
android:syncable="true"
android:authorities="one.two.databases" >
</provider>
- Have my URI been parsed correctly?
- If I extend my class to Content Provider, my database file will be kinda screwed up, is there an easier way?
however, it shows the error of not having the one.two.databases to exist.
You may want to start here:
http://developer.android.com/guide/topics/providers/content-providers.html
A few specific tips to help:
First, your URI is not a path to the database file. It starts with “content://”, then has an authority, then finally the database name (typically).
Your authority is a name you provide, usually your package name with ‘provider’ on the end. So yours might be one.two.provider.
Then you’d make a new class in your project, like MyProvider.java. Follow the example at the link up there for what to do in your provider to actually provide data.
Finally, in your AndroidManifest.xml file you’d do something like this:
This tells the android OS to hook your authority (one.two.provider) up to your class.