I want to detect incoming call type in my application.can we know incoming call is domestic or international in android.
Asked
Active
Viewed 1,124 times
0
-
http://stackoverflow.com/questions/7835876/how-are-call-types-incoming-outgoing-missed-stored-in-android-call-log – Ronak Mehta May 09 '12 at 10:49
-
http://blog.wangling.me/2009/08/why-it-is-impossible-to-intercept-incoming-calls-on-android/ – NitZRobotKoder May 09 '12 at 10:53
-
I want to know weather call is domestioc or international? – ankita gahoi May 09 '12 at 11:12
-
1basicly, its impossible. – Anders Metnik May 09 '12 at 11:20
-
cant we use the country code to acheive this? – playmaker420 Mar 14 '13 at 12:39
2 Answers
1
hey this is all about detect incoming or outgoing or missed call type in an android application. try this code this will definetly help you. i will answer you further on differentiating between an international and domestic call.
Cursor cur = managedQuery(CallLog.Calls.CONTENT_URI, new String[] {
CallLog.Calls._ID, CallLog.Calls.CACHED_NAME,
CallLog.Calls.NUMBER, CallLog.Calls.TYPE, CallLog.Calls.DATE },
null, null, CallLog.Calls.DATE + " DESC");
int typeIndex = cursor.getColumnIndex(CallLog.Calls.TYPE);
// Type of call retrieved from the cursor.
int type = cursor.getInt(typeIndex);
switch (type) {
case CallLog.Calls.INCOMING_TYPE:
//write your code here
break;
case CallLog.Calls.MISSED_TYPE:
break;
case CallLog.Calls.OUTGOING_TYPE:
break;
default:
break;
}

Abhishek
- 104
- 2
- 9
0
Can you try and get the incoming phone number and get the first couple digits. For example:+38977xxxxxx, where +389 is number from foreign country

Worker123
- 595
- 4
- 13
- 32