contacts

Get birthday for each contact in Android application

房东的猫 提交于 2019-12-17 18:14:28
问题 In my android application, I read out all the contacts with the following code: ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (cur.getCount() > 0) { while (cur.moveToNext()) { String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID)); String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); ContentResolver bd = getContentResolver(); String where = Data.RAW

How can I set a ringtone for an individual contact on Android?

纵然是瞬间 提交于 2019-12-17 15:52:19
问题 How can I apply a ringtone to only the selected contact? I have found a way to set the default ringtone that applies to all contacts, but that is not my goal. I want an application to have a button ("Apply ringtone to contact") that, when clicked, starts an activityForResult displaying a list of all contacts on the phone. When a contact is selected, the contact activity closes and returns with a URI to the contact. Then the app needs to apply the selected ringtone to that specific contact.

Round button in Android

跟風遠走 提交于 2019-12-17 10:46:28
问题 I want to create a circular button having a plus and minus sign on to this and exactly used in Android Contacts application like shown in the image as below: 回答1: You may see implementation of this button in android source code It's just ImageButton with circular png as background. Here is definition of their styles: <style name="MinusButton"> <item name="android:background">@drawable/btn_circle</item> <item name="android:src">@drawable/ic_btn_round_minus</item> <item name="android

Getting favourites contacts in Android

三世轮回 提交于 2019-12-17 10:29:25
问题 I am trying to get all contacts in the favourites list of the Android contacts. Currently, I can get all the group ids including the favourite group ID. But it seems that there is no contacts that have the group ID as the favourite group ID. I'm trying to get All groups id and contacts in each group. After printing two list, I found that the group id of favorite is not in the contact list ArrayList<String> favGroupId=new ArrayList<String>(); final String[] GROUP_PROJECTION = new String[] {

How to get whatsapp Contacts from Android Programmatically?

眉间皱痕 提交于 2019-12-17 10:19:28
问题 I have try to get whatsapp contact from phone and i get total Count of whatsapp contact but from RawContacts how to get whatsapp Number and name that i don't know. i have tried to find solution but can't get exact solution for that. Please help me. I put my code below. ContentResolver cr = context.getContentResolver(); Cursor c = cr.query( ContactsContract.RawContacts.CONTENT_URI, new String[] { ContactsContract.RawContacts.CONTACT_ID, ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY },

How to get whatsapp Contacts from Android Programmatically?

你。 提交于 2019-12-17 10:18:33
问题 I have try to get whatsapp contact from phone and i get total Count of whatsapp contact but from RawContacts how to get whatsapp Number and name that i don't know. i have tried to find solution but can't get exact solution for that. Please help me. I put my code below. ContentResolver cr = context.getContentResolver(); Cursor c = cr.query( ContactsContract.RawContacts.CONTENT_URI, new String[] { ContactsContract.RawContacts.CONTACT_ID, ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY },

Retrieve all contacts phone numbers in iOS

て烟熏妆下的殇ゞ 提交于 2019-12-17 04:34:03
问题 So far I saw methods to get multiple phone numbers if I show a picker so user can select people and then get the phone number. What I want is retrieving all contacts' numbers. Is it even possible? 回答1: Try this it works for iOS 6 as well as iOS 5.0 or older : Sample Project Demo First add the following frameworks in Link Binary With Libraries AddressBookUI.framework AddressBook.framework Then Import #import <AddressBook/ABAddressBook.h> #import <AddressBookUI/AddressBookUI.h> Then use the

Retrieve all contacts phone numbers in iOS

时间秒杀一切 提交于 2019-12-17 04:33:15
问题 So far I saw methods to get multiple phone numbers if I show a picker so user can select people and then get the phone number. What I want is retrieving all contacts' numbers. Is it even possible? 回答1: Try this it works for iOS 6 as well as iOS 5.0 or older : Sample Project Demo First add the following frameworks in Link Binary With Libraries AddressBookUI.framework AddressBook.framework Then Import #import <AddressBook/ABAddressBook.h> #import <AddressBookUI/AddressBookUI.h> Then use the

Intent基本使用

断了今生、忘了曾经 提交于 2019-12-16 22:58:36
本节我们要学习的是四大组件间的 枢纽——Intent(意图),Android通信的桥梁,比如我们可以通过: startActivity (Intent)/ startActivityForResult (Intent):来启动一个Activity startService (Intent)/ bindService (Intent):来启动一个Service sendBroadcast :发送广播到指定BroadcastReceiver 另外别忘了我们在注册四大组件时,写得很多的 Intent-Filter 哦~ 好吧,话不多说,开始本节内容!另外前面我们已经用过Intent了,就不在讲述概念性的东西了~ 老规矩,官方API: Intent 1.显式Intent与隐式Intent的区别 显式Intent :通过组件名指定启动的目标组件,比如startActivity(new Intent(A.this,B.class)); 每次启动的组件只有一个~ 隐式显式Intent :不指定组件名,而指定Intent的Action,Data,或Category,当我们启动组件时, 会去匹配AndroidManifest.xml相关组件的Intent-filter,逐一匹配出满足属性的组件,当不止一个满足时, 会弹出一个让我们选择启动哪个的对话框~ 2.Intent的七个属性: 1

Read all contacts' phone numbers in android

拟墨画扇 提交于 2019-12-16 22:40:34
问题 I'm using this code to retrieve all contact names and phone numbers: String[] projection = new String[] { People.NAME, People.NUMBER }; Cursor c = ctx.getContentResolver().query(People.CONTENT_URI, projection, null, null, People.NAME + " ASC"); c.moveToFirst(); int nameCol = c.getColumnIndex(People.NAME); int numCol = c.getColumnIndex(People.NUMBER); int nContacts = c.getCount(); do { // Do something } while(c.moveToNext()); However, this will only return the primary number for each contact,