android-contacts

Get the SIM number used on a call through the call log of Android

那年仲夏 提交于 2020-01-13 19:23:09
问题 I know Android SDK is big mess for dual SIM support, but stock dialer shows this information on call log which SIM card ( 1 or 2) was used in a call. I guess it´s stored on call log default database and just want to know if it is possible to retrieve it as simple as possible. I don´t need to know if the SIM is the current one in use. By the way, probably the call log became3s a big mess if you change the Sim cards... but it is another subject and does not matter for me (at the moment ;-) My

How to backup/restore a contacts in android programmatically?

谁说我不能喝 提交于 2020-01-13 06:27:08
问题 Hello sackoverflow I'm trying to develop an application which can backup and restore contacts, my code is as follows public class MainActivity extends Activity { Cursor cursor; ArrayList<String> vCard ; String vfile; FileOutputStream mFileOutputStream = null; Button btnRestorects = null; Button btnBackupCts = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

How to add app connections to an existing contact like WhatsApp and Viber does?

爷,独闯天下 提交于 2020-01-13 06:25:12
问题 I want my android app's connection to be added in an existing contact. I am sending my all contacts of Phonebook to server(with Name,Phone Number, and Contact ID) to check which contacts are registered for my app. I will send back to client app the contact IDs which are matched. Now I want to add connection to those contacts in my Phonebook based on those returned IDs. How can I add app connection by editing the contact based on one of returned contact ID? Thanks 回答1: Try with this code, it

How to select multiple contacts at a time?

╄→гoц情女王★ 提交于 2020-01-11 09:33:21
问题 I retrieve phonebook contacts to my application by using following code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT); } But I want to select multiple contacts and upload those to a DB. Is this possible and if so how can I do this? 回答1: Well you could query the content

How to write contactname and contactno row-wise in .csv file in Android?

偶尔善良 提交于 2020-01-11 07:07:22
问题 I want to take contactname and corresponding contact no from mobile and want to write it in .csv file. Each row will contains contact name and contact number of each person for the entire contact list. How to write contact information in .csv file? I write the code for showing contactname column but it display only one contact means its override with existing one so what should be the trick for changing the row for new contact name. My code public class contactlist extends Activity { static

Get the address of the recipient for a threaded sms

风格不统一 提交于 2020-01-06 13:31:29
问题 I have been searching how to fetch the recipient phone number for a threaded sms. A threaded sms can contain multiple recipients and i must get all the contact numbers. Can anyone pls help me. Note : i need to fetch only for sent sms so multiple receivers is possible 回答1: "content://sms/" is not officially documented and it's realisation is up to device manufacturer. there is no clean way of retrieving any sms-related info. 来源: https://stackoverflow.com/questions/7939122/get-the-address-of

Get the address of the recipient for a threaded sms

坚强是说给别人听的谎言 提交于 2020-01-06 13:31:26
问题 I have been searching how to fetch the recipient phone number for a threaded sms. A threaded sms can contain multiple recipients and i must get all the contact numbers. Can anyone pls help me. Note : i need to fetch only for sent sms so multiple receivers is possible 回答1: "content://sms/" is not officially documented and it's realisation is up to device manufacturer. there is no clean way of retrieving any sms-related info. 来源: https://stackoverflow.com/questions/7939122/get-the-address-of

How to import a Specific Contact's phone number?

自作多情 提交于 2020-01-06 04:49:06
问题 I'm trying to Read Phone number of a Contact Selected using Contact Picker. The Display Name works fine, But Phone number doesn't. Code: //calling Contact Picker public void CPick(View v){ Intent intent=new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, PICK_CONTACT); } @Override //Contact Picker here: protected void onActivityResult(int reqCode, int resultCode, Intent data){ super.onActivityResult(reqCode,resultCode, data); if (reqCode==PICK

Grab multiple number from an android contact

喜夏-厌秋 提交于 2020-01-06 04:31:08
问题 I've been searching and searching on how to grab multiple phone numbers (ie Home, Cell, Work) from a contact but I am Stumped. I'll add the code I'm using below. I hope some one can help. Thanks Jeff case CONTACT_PICKER_RESULT: Log.w("+DEBUG_TAG+","Got the Info"); //handle contact results Cursor cursor = null; String number = ""; String number2 = ""; try{ Uri result = data.getData(); //get the content id String id = result.getLastPathSegment(); //ask for the phone number cursor =

How to uniquely identify a contact on ContactsContract.Contacts table

故事扮演 提交于 2020-01-05 08:16:51
问题 I have an app that gets the ContactsContract.Contacts.LOOKUP_KEY of a contact on the device and saves it on the app Db. After reading this page I thought I could use the LOOKUP_KEY to uniquely identify a contact, even when a contact is edited (for example after editing the name of the contact). Actually I saw that after editing a contact, its LOOKUP_KEY changes, so I cannot use anymore the LOOKUP_KEY I saved on my app DB. My question is: is there a way to uniquely identify a contact on