contacts

Phonegap ContactError when saving contact on iOS 6

南楼画角 提交于 2020-01-03 06:14:10
问题 I have this posted on PhoneGap google groups and cross-posted it here on Stack Overflow. Anyway, PhoneGap's Contact API is giving me headache lately. To cut it short: Environment iOS 6 PhoneGap 2.0.0 I have this application that scans a QR code with VCard embeded, and it will save it into user's contact once the user agree to save it down. On Android 4.1.2 , this piece of code works flawlessly without any error, and contact was saved too. On iOS 6 , however, I can't get it to work. What I

Adding custom data to contacts in Android

廉价感情. 提交于 2020-01-03 05:22:28
问题 I want to add custom field to contacts that will tell me if the contact was marked in my aplication or not. First of all I want to make a function that will set my custom data to contact with given id, but the code that I try to use, don't work properly. public static final String MIMETYPE_EMPLOYEE = "vnd.android.cursor.item/employee"; public void addEmployee(String id){ ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); Uri newContactUri = null; ops.add

update contacts display_name

送分小仙女□ 提交于 2020-01-03 04:09:10
问题 How do I update the display name for a contact? The operation in the code below completes without throwing anything and appears to work - that is, when I requeried the ContactsContract.Contact table, a row came back with the name changed. However, when I tried running the stock "people" app on my tablet, it crashed. Evidentally I did something wrong. Here is the code. Early on, it fetches an id from the aggregate contacts as follows, where key is the lookup_key: String[] projection = new

Android Get Random Contact

こ雲淡風輕ζ 提交于 2020-01-03 03:19:06
问题 I'm trying to get a random contact from a phone's contact list, but without noticeably slowing down the phone. That means that I can't just grab all the contacts and stick them into an array and pick a random one from that array. I'd like to be able to get a random contact without having to get all of the contacts first. Is this possible, and if so, how would I go about doing it? 回答1: Updated to use non-deprecated code. Query based on this answer: How to read contacts on Android 2.0 Cursor

Attempting to get contact _ID using email address

余生颓废 提交于 2020-01-03 01:56:08
问题 I know that with aggregation contact _ids are not static, but may change over time (see: Google Group Discussion). So, in my app I am storing the content lookup key and the current id of a selected contact. What I am trying to do is this: when a message comes in from a particular email address, query the phone contacts and see if that from email address is associated with any of them, and then compare that contact with my stored contact, first doing a fresh query using my stored contact _id

Android: get contact id after insert

吃可爱长大的小学妹 提交于 2020-01-02 04:33:04
问题 I need to store the contact id value after create a new contact, in order to be able to reference it in other moment. For example, I create a new contact, and after that I want to delete it from its contact id, so I need to retrieve the contact id value after create a new contact. This is how I create new contacts: ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI).withValue

How do you get contacts to aggregate properly when programmatically adding them?

。_饼干妹妹 提交于 2020-01-02 02:52:06
问题 I saw this question and answer, but adding the phone information (and even email) still does not cause the contact information to aggregate properly (when I check the People app, I can see multiple entries under the same name). Here is the code I use to test it. //get the account Account acct = null; Account[] accounts = AccountManager.get(getContext()).getAccounts(); for (Account acc : accounts){ acct = acc; }//assuming there's only one account in there (in my case I know there is) //loop a

Intent.ACTION_PICK returns empty cursor for some contacts

谁都会走 提交于 2020-01-02 00:55:15
问题 I have an app in which one aspect is for a user to select a contact and send a text to that contact thru the app. The app only works with some contacts and fails on others. More precisely: for the contacts that I entered into my contact book by hand, the Intent.ACTION_PICK has no trouble finding and returning them to the app, i.e. cursor.moveToFirst() is true. But for the contact that were imported by Facebook (my phone is set to sync with Facebook contacts), I get the following android

Hiding UITableViewCells when entering edit mode in UITableViewCell (similar to Contacts app)

夙愿已清 提交于 2020-01-01 16:42:09
问题 Does anyone know how to hide a number of cells from the grouped UITableView when entering in edit mode? I would like the rows to hide with animation effect as seen in the Contacts app when going out of editing mode. As you know, when in Contacts editing mode, there are more rows than when switching back to normal mode. I would like to know how the switching is done smoothly. Note that my UITableView subclass is loading static UITableViewCells from the same nib using IBOutlets. 回答1: When you

iPhone Address Book: How to get a list of only contacts with phone numbers?

送分小仙女□ 提交于 2020-01-01 03:31:09
问题 I'd like to get a list of all ABContacts that have a phone number and only those contacts. Any contacts with just an email I do not want to show. Android has a field called HAS_PHNONE_NUMBER you can query on but I'm not seeing anything like that for iPhone. For example: ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); //How do I filter people into an array of contacts that all have a phone number? 回答1: You can use this