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
Post a Comment