How to block calls in android

I want to block calls from multiple numbers because I want to write my own application. So which APIs should I use?

Basically, I want to receive notifications when a call comes in, I want to compare numbers, if this is what I want to block, I want to cut the call or turn it off, or if possible, turn it off and record.

+66
android phone-call incoming-call
Jul 05 '09 at 5:52
source share
5 answers

OMG !!! YES, WE CAN DO IT !!! I was going to kill myself after a harsh 24 hours of investigation and discovery ... But I found a "new" solution!

// "cheat" with Java reflection to gain access to TelephonyManager's // ITelephony getter Class c = Class.forName(tm.getClass().getName()); Method m = c.getDeclaredMethod("getITelephony"); m.setAccessible(true); telephonyService = (ITelephony)m.invoke(tm); 

to all the hundreds of people who want to develop their call management software, visit this starting point

there is a project. and there are important comments (and loans)

briefly: copy the help file, add permissions for the manifest, copy-paste the source to control telephony)))

Additional information for you. AT commands that you can send only if you are rooted. How can you kill the system process and send commands, but you will need to reboot so that your phone can receive and send calls =)))

I am very hapy =) Now my Shake2MuteCall will receive an update!

+63
Jun 18 '10 at 18:15
source share

At the moment, the Mission is impossible . See Why it is not possible to intercept incoming calls on Android for more information.

+14
Aug 03 '09 at 14:54
source share

It is possible, and you do not need to code it yourself.

Just set the ringer volume to zero and vibration to none if the incoming number is an empty line. Here it is...

It's just made for you using the Nostalk app from the Android Market. Just try it ...

+5
Sep 20 '09 at 10:12
source share

You can simply redirect specific numbers to your contacts to your voicemail. This is already supported.

Otherwise, I think that the documentation for Contacts would be a good place to start your search.

+3
Jul 05 '09 at 6:25
source share

Like UPDATE in android-N, this feature is included in it.

Visit Number-blocking

Android N now supports platform number blocking and provides an infrastructure API so that service providers maintain a list of blocked numbers. Default SMS application, default phone application, and provider applications can read from and write to the list of blocked numbers. The list is not available in another application.

Advantage

is as follows:

  • Numbers blocked during calls are also blocked in the text.
  • Blocked numbers can be saved during discharges and devices through Backup and Restore
  • Multiple applications can use the same list of blocked numbers

For more information, see android.provider.BlockedNumberContract in the API Reference .

Update an existing project.

To compile the application on the Android N platform, you need to use the Java 8 Developer Kit (JDK 8) , and to use some tools with Android Studio 2.1 , you need to install the Java 8 Runtime Environment (JRE 8) .

Open the build.gradle file for your module and update the values ​​as follows:

 android { compileSdkVersion 'android-N' buildToolsVersion 24.0.0 rc1 ... defaultConfig { minSdkVersion 'N' targetSdkVersion 'N' ... } ... } 
+3
Mar 10 '16 at 9:47
source share



All Articles