I have just started with phoneGap and Android. Built basic samples.
I would like to know, if there is an API to get the call logs. I wish to create a grid showing:
- Number of missed calls over a period of time
- Number of received calls
- Number of calls made
- Total time of the received calls and calls made
Thanks in advance.
I did a bit of research and has successfully built a PhoneGap plugin which would fetch the CallLog from
android.provider.CallLog.This returns an JSON
{ Rows: [] }whereRowsis an 2 dimensional array of call records containing the following fields (as Array) in the following order :Details are in http://developer.android.com/reference/android/provider/CallLog.Calls.html
I have also made a small sample using this plugin which would show total number of outgoing calls, missed calls and incoming calls and plot them in a Pie chart. The sample is using FusionCharts’ Pie chart.
You can download a beta try-out .apk from :
http://www.sudipto.net/download/android/apps/CallLog/beta/CallChart.apk.zip
(using JavaScript SVG charts that works in Android version 3 or above)
Here is the source-code zip for you to delve into:
http://www.sudipto.net/download/android/apps/CallLog/beta/calllog_phonegap_eclipseclassic_source.zip
Here is my complete code:
CallLog.javacalllog.phonegap.jsApplication.java