calllog

Android: get call history of contact

自闭症网瘾萝莉.ら 提交于 2019-11-29 11:44:49
i am using this code the get to the contact info of a contact (i am using it also - with a few modifications - to call, send sms or email the contact). I wonder if there is a way to show the call history of a certain contact: String name3 is the contact name. contactinfobtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (cur.getCount() > 0) { while (cur.moveToNext()) { id_contact = cur.getString(cur.getColumnIndex(ContactsContract

Android Get Contact Picture from Call Log

我的梦境 提交于 2019-11-29 08:10:36
It was pretty easy to get the Contact picture when querying the People.CONTENT_URI , with a simple People.loadContactPhoto(activity, ContentUris.withAppendedId(People.CONTENT_URI, contactId) because I knew the contact Id. Now I need to do the same thing after accesing the Call log. With: String[] strFields = { android.provider.CallLog.Calls.CACHED_NAME, android.provider.CallLog.Calls.NUMBER, }; String strUriCalls="content://call_log/calls"; Uri UriCalls = Uri.parse(strUriCalls); Cursor cursorLog = this.getContentResolver().query(UriCalls, strFields, null, null, null); I get the list from call

Is it possible to detect rejected calls in Android?

你说的曾经没有我的故事 提交于 2019-11-29 05:02:59
In my application, it would be nice to intercept when the user rejects a call, i.e. choose to send busy tone. Is there any way, besides being notified when there is an incoming call, to do this? I have not found anything in the docs regarding this. Is this information stored in the call log, i.e. can I poll the call log to see if a call was rejected or answered? Hey. You could use the PhoneStateListener and CallLog classes to query the recent calls list to find rejected calls. http://developer.android.com/reference/android/provider/CallLog.html http://developer.android.com/reference/android

I want to read call logs in the android [duplicate]

只谈情不闲聊 提交于 2019-11-29 04:06:06
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How can I retrieve recently used contacts in android? I want to read recently used contacts. Anyone know how to do this? 回答1: 1. Create observer: class CustomContentObserver extends ContentObserver { public CustomContentObserver(Handler handler) { super(handler); } @Override public boolean deliverSelfNotifications() { return false; } public void logCallLog() { long dialed; String columns[]=new String[] { CallLog

Delete call log in android for particular number

一笑奈何 提交于 2019-11-28 00:28:57
I am trying to delete all call logs of particular number. try { String strNumberOne[] = {number}; Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + "=? ", strNumberOne, ""); boolean bol = cursor.moveToFirst(); if (bol) { do { int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID)); getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null); } while (cursor.moveToNext()); } } catch (Exception ex) { System.out.print("Exception here "); } I want to fire a LIKE query,

Is it possible to detect rejected calls in Android?

人盡茶涼 提交于 2019-11-27 18:44:17
问题 In my application, it would be nice to intercept when the user rejects a call, i.e. choose to send busy tone. Is there any way, besides being notified when there is an incoming call, to do this? I have not found anything in the docs regarding this. Is this information stored in the call log, i.e. can I poll the call log to see if a call was rejected or answered? 回答1: Hey. You could use the PhoneStateListener and CallLog classes to query the recent calls list to find rejected calls. http:/

How can I update the contents of an entry in the Call Log?

雨燕双飞 提交于 2019-11-27 15:25:12
问题 I would like to update the CallLog.Calls.TYPE field of the first entry in the Android Call Log from MISSED to INCOMING . I have read books, the developers reference and googled this to death and am reasonably sure that my code is correct. However, when I actually make the call to update() , the result is that no record is updated. My code sample is below. Before you ask: - I have permissions for WRITE_CONTACTS - The record to be updated (0) does exist - I have tried this on both a DroidX

Get Last Call Duration in android

旧街凉风 提交于 2019-11-26 22:25:29
问题 I am looking for an easiest way to get call duration of last dialed number. So for e.g if I have made a call to my mom once I cut the call a notification with the duration should come up. I am trying out the following but the problem is that it comes with a full list of duration. incoming, outgoing, missed. How do I differentiate it: I tried the following: private void getCallDetails() { StringBuffer sb = new StringBuffer(); Cursor cur = getContentResolver().query( CallLog.Calls.CONTENT_URI

How to implement a ContentObserver for call logs

为君一笑 提交于 2019-11-26 19:53:49
I'd like to know if there is a way to know if the content provider of callings has changed. I mean, if I make a call, or I answer a call, it returns a "flag" that a new log has been added to the call log, or the place where Android store informations about callings. Because, when I make a call, Android stores the number, the contact name (if exists), the hour of the calling, the duration, ..., all in the content provider. So is there a way to capture this "flag" that says the content provider of callings is bigger, I mean, that a new data has been inserted on the content provider CallLog.Calls

How to implement a ContentObserver for call logs

喜欢而已 提交于 2019-11-26 07:28:43
问题 I\'d like to know if there is a way to know if the content provider of callings has changed. I mean, if I make a call, or I answer a call, it returns a \"flag\" that a new log has been added to the call log, or the place where Android store informations about callings. Because, when I make a call, Android stores the number, the contact name (if exists), the hour of the calling, the duration, ..., all in the content provider. So is there a way to capture this \"flag\" that says the content