How do I access call log for android? -


i receive call log. example number of calls made user, number of minutes called, etc.

how achieve in android?

this accessing phone call history:

as of jellybean (4.1) need following permission:
<uses-permission android:name="android.permission.read_call_log" />

code:

 uri allcalls = uri.parse("content://call_log/calls");  cursor c = managedquery(allcalls, null, null, null, null);  string num= c.getstring(c.getcolumnindex(calllog.calls.number));//  number string name= c.getstring(c.getcolumnindex(calllog.calls.cached_name));// name string duration = c.getstring(c.getcolumnindex(calllog.calls.duration));// duration int type = integer.parseint(c.getstring(c.getcolumnindex(calllog.calls.type)));// call type, incoming or out going. 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -