contactscontract

Created contacts not showing up on HTC Evo

↘锁芯ラ 提交于 2019-12-19 10:48:27
问题 I'm writing a program that imports our contacts into the Contacts db on the phone so they show up in the Contacts app, are available for caller id to draw from, etc. I've got it working the way we want on the emulator and the Motorola Droid. When I go to Menu --> View, I can see our application with a check box next to it, and when it's checked, our contacts show up fine. However, when I try the same thing on the HTC Evo, the contacts don't show up in People, and I don't have our application

Created contacts not showing up on HTC Evo

℡╲_俬逩灬. 提交于 2019-12-19 10:48:09
问题 I'm writing a program that imports our contacts into the Contacts db on the phone so they show up in the Contacts app, are available for caller id to draw from, etc. I've got it working the way we want on the emulator and the Motorola Droid. When I go to Menu --> View, I can see our application with a check box next to it, and when it's checked, our contacts show up fine. However, when I try the same thing on the HTC Evo, the contacts don't show up in People, and I don't have our application

Get contacts with email id

你离开我真会死。 提交于 2019-12-19 10:35:12
问题 I need to get contacts information(cursor) with email. They must be distinct. There must be one entry per contact if he has got an email. How to do it? I am targetting new contacts API comes with 2.0. 1)I tried to do it using CursorJoiner, but a strange thing happens. Here is my code : MatrixCursor matCur = new MatrixCursor( new String[]{ Contacts._ID, Contacts.DISPLAY_NAME, "photo_id", "starred" } ); Cursor newContactCursor = managedQuery( ContactsContract.Contacts.CONTENT_URI, new String[]{

How do implicit joined columns work with Android contacts data?

微笑、不失礼 提交于 2019-12-18 14:10:53
问题 I'm querying the ContactsContract.Data table to find phone records. I get an error when I create a new CursorLoader : java.lang.IllegalArgumentException: Invalid column deleted My code: import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; ... String[] projection = { Phone.DELETED, Phone.LOOKUP_KEY, Phone.NUMBER, Phone.TYPE, Phone.LABEL, Data.MIMETYPE, Data.DISPLAY_NAME_PRIMARY }; // "mimetype = ? AND deleted = ?" String selection =

How do implicit joined columns work with Android contacts data?

这一生的挚爱 提交于 2019-12-18 14:10:01
问题 I'm querying the ContactsContract.Data table to find phone records. I get an error when I create a new CursorLoader : java.lang.IllegalArgumentException: Invalid column deleted My code: import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; ... String[] projection = { Phone.DELETED, Phone.LOOKUP_KEY, Phone.NUMBER, Phone.TYPE, Phone.LABEL, Data.MIMETYPE, Data.DISPLAY_NAME_PRIMARY }; // "mimetype = ? AND deleted = ?" String selection =

Insert contact in Android with ContactsContract

烈酒焚心 提交于 2019-12-17 18:19:02
问题 I am trying to add a new contact to the Android 2.2 contacts directly. //this code doesn't work ContentValues cv=new ContentValues(); cv.put(ContactsContract.Contacts.DISPLAY_NAME, "TESTEST"); Uri u= getContentResolver().insert(ContactsContract.Contacts.CONTENT_URI, cv); gives me the error "Aggregate contacts are created automatically." What am I doing wrong? This calls the Android's add contact form : //this code works but it's not ideal Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT); i

How to get Contact ID, Email, Phone number in one SQLite query ? Contacts Android Optimization

妖精的绣舞 提交于 2019-12-17 17:34:23
问题 I want to fetch All Contacts atleast with one phone Number, also I want all Phone Numbers and All emails for every Contact. Current code : // To get All Contacts having atleast one phone number. Uri uri = ContactsContract.Contacts.CONTENT_URI; String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER + " > ?"; String[] selectionArgs = new String[] {"0"}; Cursor cu = applicationContext.getContentResolver().query(uri, null, selection, selectionArgs, null); // For getting All Phone Numbers

How do I make my Android ContentObserver for ContactsContract detect a added, updated or deleted contact?

柔情痞子 提交于 2019-12-17 15:37:39
问题 I am able to get a generic notification "that there was a change to the contacts DB", but I want to know the specific record that was inserted, updated, or deleted. Following is the code that gets registered and gets the onChange notification. Unfortunately, it is not specific which makes my processing exhaustive and inefficient. Here is the code stub: if ((mNativeContactsObserver == null) && (mHandler == null)) { mHandler = new Handler(this.getMainLooper()) { }; mNativeContactsObserver = new

Modifying contact information

别等时光非礼了梦想. 提交于 2019-12-17 06:38:25
问题 I'm trying to insert and update a piece of information on an existing contact so I've created a sample application in order to develop the functionality. All I want my sample app to do is to insert (or if present) update an email address on a contact. I'm selecting a contact through the system Intent like so: startActivityForResult(new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI), PICK_CONTACT_REQUEST); The URI which is returned is that of the Contact ( RawContact ?) which was selected

Function to update a photo in ContactsContract

一世执手 提交于 2019-12-14 02:28:38
问题 I try to update a photo in ContactsContract with a function who take the id of the contact and the uri of the picture but it seem it's not working (and my function return true ). I really don't understand because the code look good. It seem it's working when the contact have already a photo... This is my function : boolean updatePhoto(String idStr, String uri){ if (uri != null) { ArrayList<ContentProviderOperation> ops = new ArrayList<>(); File imgFile = new File(uri.replace("file://", ""));