android-contacts

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

How to detect the default phone number of a contact (if set)

放肆的年华 提交于 2019-12-19 07:32:51
问题 ATM I get the number and label of a given CONTACT_ID with String where = ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId; Cursor c = ctx.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, where, null, null); while (c.moveToNext()) { String number = Tools.getString(c, CommonDataKinds.Phone.NUMBER); String label = Tools.getString(c,CommonDataKinds.Phone.LABEL); } Android has the ability to mark a given number as "default number". How can I

Get sorting order preference selected user in Contacts>settings in Android Device and How to reduce query time?

我的梦境 提交于 2019-12-19 02:01:31
问题 I have two questions: 1: How can my application know Default sorting order used for sorting native "Android Device Contacts"? Inside "Contacts" -> "Settings" in android, we have " List by " and " Display Contacts by" options. How can I get these prefrences in my application. For example: suppose device contacts are sorted by "First Name", then application should get some constant(or something similar). On the other hand, if contacts are sorted by "Last Name" then application should get

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 =

Android : How to populate a ListView with alphabet indexer and fastscroll as in contacts app.?

荒凉一梦 提交于 2019-12-18 12:33:10
问题 I would like to implement a ListView with fastscroll and albhabet indexer as in the contacts application. I'm using a SimpleAdapter to populate the ListView. As seen from the image, by selecting a letter from the alphabet indexer at the right, the listView selection goes to the corresponding ListItem. How to accomplish this? Please help. 回答1: As I can't see your posted image, but I think Here is the way to implement Section Indexing in Android as iPhone has, You should also refer

AutoComplete TextView with Contacts

旧巷老猫 提交于 2019-12-18 12:09:08
问题 i need to display an auto complete text box which will basically load the contacts e-mail ids. I have tried it using a custom adapter but nothing gets populated in the textbox. No suggestions at all. Any solutions will be very useful. 回答1: Try the following: ArrayList<String> emailAddressCollection = new ArrayList<String>(); ContentResolver cr = getContentResolver(); Cursor emailCur = cr.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, null, null, null); while (emailCur

How to send and receive SMS from android app? [closed]

耗尽温柔 提交于 2019-12-18 10:06:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to add sms sending feature in my app and also want option in which user can select the contacts from the contact list directly from the application. Is there way that contact list can be integrated with my application. Thanks 回答1: And here is a Tutorial Showing step by step

Dirty flag not getting set to “1” on contact update

拟墨画扇 提交于 2019-12-18 09:29:45
问题 I am working on a project in which I want to detect the changes in the Contacts. So I have created Account with Account manager and trying to find the changes in the contact list using DIRTY flag. But the DIRTY flag not getting set for my app account_type when contact updated. however DIRTY flag of another account_type(com.google) is getting set. Help me This is how I am inserting contacts with my account and account_type. public static void addContact(Context context,MyContact contact){

How to Update contact image using contact provider operation.

回眸只為那壹抹淺笑 提交于 2019-12-18 07:03:46
问题 The following code is used to update the image but it throws illegal or bad value exception.any body can solve this. Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap(); File f = new File(picturePath); Uri photoUri = Uri.fromFile(f); add to array list coding ops.add(ContentProviderOperation .newUpdate(ContactsContract.Data.CONTENT_URI) .withSelection( ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?", new String[] { contactid,