input speech (Experimental) gave me value with text (name of contact)
need search contact witn name(value) in database android and extract number of phone or other info.
I try do it with http://stackoverflow.com/questions/6994 ... in-android
or like this code (i know, that search name by number)
Code: Select all
Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(contactNumber));
ContentResolver cr = getContentResolver();
Cursor c = cr.query(uri, new String[] {BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME }, null, null, null);
String contactName;
try {
if (c != null && c.getCount() > 0) {
c.moveToNext();
contactName = c.getString(c.getColumnIndex(ContactsContract.Data.DISPLAY_NAME));
}
} finally {
if (c != null) {
c.close();
}
}
How can i do it? Run outdoor scripts in storage/scripts?