I use this code in android app to get the missed call.
cursor = this.getContentResolver().query(
Uri.parse("content://call_log/calls"),
projection,
selection,
selectionArgs,
sortOrder
);
while (cursor.moveToNext()) {
String callType = cursor.getString(
cursor.getColumnIndex(android.provider.CallLog.Calls.TYPE));
String isCallNew = cursor.getString(
cursor.getColumnIndex(android.provider.CallLog.Calls.NEW));
if (Integer.parseInt(callType) == CallLog.Calls.MISSED_TYPE
&& Integer.parseInt(isCallNew) > 0) {
missedCallCount++;
}
But it doesn't work when i use this code in android watch app. Anyone know how to access the CALL_LOG in android watch?
I think one of the way to solve this problem is build an app in phone & watch, then phone's app access CALL_LOG and send it to watch's app by using bluetooth. But i want to just build app in watch slide to solve this problem.