I want to reject incoming in android, I have seen so many code from these links.
Android: Taking complete control of phone(kiosk mode), is it possible? How?
http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html
But I am still unable to do it, can anybody tell me in simple and easy steps how to do it?
This is the best tutorial to block all incoming calls you can customize it to block incoming call of only selected numbers.
Android Incoming Call Block
Provide appropriate permission and add the
ITelephony.java
fileCreate an interface in
com.android.internal.telephony
and name asAdd necessary permission in Manifest
You will be needing a broadcast receiver for that with an intent filter I think ACTION_ANSWER
more details about it here: http://developer.android.com/reference/android/content/Intent.html#ACTION_ANSWER
You can register it using the manifest file or the method registerReceiver
more info here: http://developer.android.com/reference/android/content/Context.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)
Also you need to specify appropriate permissions in the manifest file.
The links you have provided are quite good. You just need more patience :)
happy coding.
In order to intercept your call you just have to:
1. Make a package named. com.android.internal.telephony;
2. In this package make a interface file named ITelephony.
and write this code in that interface file.
Now in your class where you want to intercept the call extend that class to
BroadcastReceiver
and inonReceive()
function write the following code.Thats it.