I am using the generic columns DATA1 to Data15 to store some data. My question is whether it is safe to assume that these columns are not being used by other android applications to store their own data. IF not how would I make sure that a particular column is not being used by any other application?
ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
.withValue(Data.DATA10,"Data")
Retrive data:
ContentResolver cr=context.getContentResolver();
Cursor emailCur = cr.query(
ContactsContract.Data.CONTENT_URI,
null,
ContactsContract.Data._ID + " = ?",
new String[]{str_id}, null);
while (emailCur.moveToNext())
{
String name=emailCur.getString(
emailCur.getColumnIndex(Data.DATA10));
}
It will be safe, if you use your own MIME type value for the MIMETYPE column. When querying the data table, a MIME is specified to query for specific results (Phone numbers, names, addresses and so on), so if you use a value special for your application, other applications will probably not use it/change it.
Read more about the data table here.
EDIT: Append this call to the
ContentProviderOperationcreation chain: