I would like to use SQLiteStatement in my ContentProvider instead of the rawQuery or one of the other standard methods. I think using SQLiteStatement would give a more natural, native, efficient and less error prone approach to doing queries.
The problem is that I don’t see a way to generate and return a Cursor. I realize I can use “call” and return a Bundle, but that approach requires that I cache and return all selected rows at the same time – this could be huge.
I will start looking at Android source code – I presume that “query” ultimately uses SQLiteStatement and somehow generates a Cursor. However, if anyone has any pointers or knowledge of this, I would greatly appreciate your sharing.
Quoting the documentation for
SQLiteStatement:I fail to see why you would bother with a
ContentProviderfor single row, single column results, but, hey, it’s your app…Create a
MatrixCursorand fill in the single result.