calllog

How to get contacts with which the user talks often?

感情迁移 提交于 2019-12-06 03:33:40
问题 Is it possible using ContactsContract to get contacts with which the user talks often? I know I can use the CallLog ContentProvider and try to figure that out, but I wanted to know if there is already a way to do it. 回答1: The number of times a contact has been contacted ContactsContract.Contacts.times_contacted static final String[] CONTACTS_SUMMARY_PROJECTION = new String[] { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.STARRED,

Get last call details from Call Log

落花浮王杯 提交于 2019-12-05 02:15:29
问题 I am using below code to get last call details from call log. public static CallDetails getLastCallDetails(Context context) { CallDetails callDetails = new CallDetails(); Uri contacts = CallLog.Calls.CONTENT_URI; try { Cursor managedCursor = context.getContentResolver().query(contacts, null, null, null, android.provider.CallLog.Calls.DATE + " DESC limit 1;"); int number = managedCursor.getColumnIndex(CallLog.Calls.NUMBER); int duration = managedCursor.getColumnIndex(CallLog.Calls.DURATION);

Android showing device Call-Log screen after call gets finished/End [duplicate]

余生颓废 提交于 2019-12-04 18:50:20
Possible Duplicate: How to make a phone call in android and come back to my activity when the call is done? I am trying to make/initiate call using (Uri with Intent) following code in Android on Nexus-S: Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:"+phoneNo)); startActivity(callIntent); On Nexus-S after call gets finished it is showing Device Call Logs screen instead of going back to my activity. Is there any way that device native call logs screen should not appear after call ends, and return back to my activity or some other activity which I would

get last Call on CallLog using a Service

血红的双手。 提交于 2019-12-04 18:24:23
I'm doing a program to send the CallLog to a Server, I created a Service that makes a poll of the telephone status with the following method. This method is called onCreate. private void pollForCallStatus() { timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Log.d("Poll", Integer.toString(telephonyManager.getCallState())); switch (telephonyManager.getCallState()){ case TelephonyManager.CALL_STATE_RINGING: Log.d("CallService", "ringing"); break; case TelephonyManager.CALL_STATE_OFFHOOK: callStart(); break; case TelephonyManager.CALL_STATE_IDLE: callEnd(); break; } } }, 0

CallLog.Calls.CACHED_NAME is always returning null for some saved contacts

↘锁芯ラ 提交于 2019-12-04 13:31:27
I am trying to show the call log details in my app but CallLog.Calls.CACHED_NAME is always returning null for some contacts even if it is a saved contact with name. The built-in call log is showing the names for these contacts correctly. This is my code: protected customAdapRecent doInBackground(Void... params) { ContentResolver resolver = context.getContentResolver(); final String[] PROJECTION = new String[] { // CallLog.Calls.CACHED_LOOKUP_URI, CallLog.Calls.NUMBER, CallLog.Calls.CACHED_NAME, CallLog.Calls.TYPE, CallLog.Calls.DATE, CallLog.Calls.DURATION }; Cursor cursor = resolver.query

How to get contacts with which the user talks often?

删除回忆录丶 提交于 2019-12-04 07:16:31
Is it possible using ContactsContract to get contacts with which the user talks often? I know I can use the CallLog ContentProvider and try to figure that out, but I wanted to know if there is already a way to do it. The number of times a contact has been contacted ContactsContract.Contacts.times_contacted static final String[] CONTACTS_SUMMARY_PROJECTION = new String[] { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.STARRED, ContactsContract.Contacts.TIMES_CONTACTED, ContactsContract.Contacts.CONTACT_PRESENCE, ContactsContract.Contacts.PHOTO

How can we hide call logs of specific contact in android?

匆匆过客 提交于 2019-12-03 21:46:25
I am trying to hide call logs from particular contact. For this I have created broadcast receiver for receive event of incoming / outgoing / missed call / call hangup. But how can I get call details on call hangup event ? I know we can get following 2 informations when incoming event occurs : 1) State 2) Phone Number Now for hide contact, I need to delete entry from defalut call log database which is located in “content://call_log/calls” ., and insert it inside my sqlite database. Is there anybody who faced this kind of issue before ? Any help will be appreciated. Thanks. JstnPwll Perhaps a

how to mask missed calls to read in android?

筅森魡賤 提交于 2019-12-02 21:49:41
问题 I am working to an android app that displays the missed calls using: String[] projection = new String[]{CallLog.Calls.NUMBER, CallLog.Calls.TYPE, CallLog.Calls.DURATION, CallLog.Calls.CACHED_NAME, CallLog.Calls._ID}; String where = CallLog.Calls.TYPE+"="+CallLog.Calls.MISSED_TYPE+" AND " + CallLog.Calls.NEW + "=1" ; Cursor c = context.getContentResolver().query(CallLog.Calls.CONTENT_URI,projection,where, null, null); c.moveToFirst(); if(c.getCount() > 0) newCountersObj.missedCallCounter=c

clear missed calls and clear notification from android bar

无人久伴 提交于 2019-12-02 20:49:06
问题 Using this code I managed to mark all missed calls as read: ContentValues values = new ContentValues(); values.put(Calls.NEW, 0); if (android.os.Build.VERSION.SDK_INT >= 14) { values.put(Calls.IS_READ, 1); } StringBuilder where = new StringBuilder(); where.append(Calls.NEW); where.append(" = 1 AND "); where.append(Calls.TYPE); where.append(" = ?"); context.getContentResolver().update(Calls.CONTENT_URI, values, where.toString(), new String[]{ Integer.toString(Calls.MISSED_TYPE) }); but in the

Samsung device returns text messages when querying for call-log

匆匆过客 提交于 2019-12-02 00:49:11
问题 Some of my users report that on their Samsung devices (GT-N7000 & SGH-I777) a query I make in my app for the CallLog.Calls displays also text messages. I've created a dump of their CallLog ContentProvider , and it seems to have extra fields not mentioned in the Android API, and not returned on any of our test devices. Specifically, looking through the dump, there's a field called logtype , which seems to equal 100 for calls, and 300 for text messages. Having searching online for this field, I