I have been unsuccessfully trying to access database trough content provider for couple of days now.
I think that I don't understand the syntax of the Uri that is used to point to the database. Maybe I don't understand correctly the Android developer's documentation about the format of Uri.
I have a database which name is "testdatabase.db", table which name is "table1" and a class named DbProvider
that subclasses ContentProvider
. The database is created successfully and I can make queries to it using adb shell, but when I try to make queries from client, I got IllegalArgumentException Unknown uri: content://com.test.dbprovider/testdatabase.db
Could somebody please explain what is the correct format of Uri in my case? And what is the syntax of authority part of provider? Can an authority be named for example com.test.foo
and it should still work or should the last part after dot be a class name or something like that?
I have also made the necessary provider tags to AndroidManifest.xml
file.