calllog

Xamarin C# Android Call Logs

徘徊边缘 提交于 2021-02-20 04:34:42
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

Xamarin C# Android Call Logs

邮差的信 提交于 2021-02-20 04:34:13
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

Identify Call logs from Sim1 and Sim2

被刻印的时光 ゝ 提交于 2021-02-18 19:33:13
问题 I'm trying to show call logs from Sim1 and Sim2 separately. I'm getting all call logs, but not able to differentiate it whether it is from Sim1 or Sim2. I have tried below code, val managedCursor = activity?.contentResolver?.query(CallLog.Calls.CONTENT_URI, null, null, null, null) managedCursor?.let { val number = managedCursor.getColumnIndex(CallLog.Calls.NUMBER) val name = managedCursor.getColumnIndex(CallLog.Calls.CACHED_NAME) val type = managedCursor.getColumnIndex(CallLog.Calls.TYPE) val

Android pick up entry from call history screen

為{幸葍}努か 提交于 2020-01-30 04:03:12
问题 I have been able to reach the call logs screen of my phone using the below code i got from internet. Is it possible to pick up the entry details, say number, time of call etc of single entry with on click ? Intent showCallLog = new Intent(); showCallLog.setAction(Intent.ACTION_VIEW); showCallLog.setType(CallLog.Calls.CONTENT_TYPE); startActivity(showCallLog); 回答1: You can not use a intent to pick a single entry from logs. But you can get all info from db and show them into a dialog list and

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

Android onChange() method only returns false

无人久伴 提交于 2020-01-05 04:37:04
问题 I have a ContentObserver onChange() declared as a subclasse in my activity. But it always returns false. Can anyone tell me why? (Update) This code must call the fillList if the CallLog content provider changes. I mean, if I make a new call, so the data of the call will be inserted in the content provider, so it must return to the observer that something has changed there, so it will call the fillList().But it always return false, even If I make a new call on the emulator. Here is the code.

How to read call log history of a device in android in 6.0

[亡魂溺海] 提交于 2020-01-05 04:18:13
问题 My main aim of the app is to read the call history of the device and show it to the user using recyclerview and cardview. But When i run on marshmallow device app getting force close. Here is the code that i have used to read call history and the error that i got, when i run on 6.0 My MainActivity look like: public class MainActivity extends AppCompatActivity implements Callbacks { ArrayList<CallLogItem> mItems = new ArrayList<>(); private RecyclerView mRecyclerView; private RecyclerView

How do you clear your call logs history in android?

一世执手 提交于 2020-01-01 10:58:24
问题 How can you clear the entire call log history in android? Currently i have this code that can only clear a particular call log public void DeleteCallLogByNumber(String number) { String queryString="NUMBER="+number; this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,queryString,null); } } 回答1: I was able to do it with this, It's been a while though. Not sure if this still works. getContentResolver().delete(android.provider.CallLog.Calls.CONTENT_URI, null, null) ; EDIT: Please note I am

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

别说谁变了你拦得住时间么 提交于 2020-01-01 07:08:15
问题 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

clear missed calls error in android.database.SQLite

时光毁灭记忆、已成空白 提交于 2019-12-25 05:27:20
问题 I have the following code for clear missed logs: ContentValues values = new ContentValues(); values.put(Calls.NEW, 0); 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) }); When running this code I get the following exception: Caused by: