We could insert data into database without using the Uri. But when we are using contentResolver we need the Uri to do anything.
Like getContentResolver().insert(CONTENT_URI, values); But in Database query execution we do not need any Uri. Like db.execSQL(String query);. Why is this?
While I think this question is about to be closed, I think what you are asking is why when you use a content resolver you have to use a CONTENT_URI, but when using a database you dont?
Content Provider
This is because Content Resolvers provide more functionality than just a database
Database
With a database, it is not accessible from ANY application via a Content Provider (unless you write one). Using db.execSQL, you are only querying your database and not a content provider, thus you don’t need to provide a CONTENT_URI. Your
dbobject IS the data store.