I am using custom built content provider to pull data from my database. There can be many records(like 10k) so instead of implementing some mechanism of lazy loading to a list, I took a chance and created content-provider as it has internally a mechanism for "lazy loading". All works well. I need to add a field (column) which should not go in database, but it is a selector, a check-box. Say this is a list of some users loading from DB, and I want to create something close to WhatsApp "add contacts to broadcast" (see image)
The code for content provider is nothing special:
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
................
Cursor cursor = customContactsDataBase.getContacts(id, projection, selection, selectionArgs, sortOrder);
return cursor;
}
And getContacts is a simple SQLiteQueryBuilder returning a cursor.
So, my question is, should I inject this new check-box column, if yes, then where to keep the values (in a separate "matching by id" list or a map and dynamically fill the values) Or should I use some other mechanism ?