Android Call Blocker - Android Studio Tutorials

Create New Project

  • Application Name : Call Blocker Example
  • Company Name : tutorialscafe.com (this will make the package name : com.tutorialscafe.callblockerexample)
  • Project Location : C:\Users\USER\AndroidStudioProjects\CallBlockerExample
  • Select the Minimum SDK for you app:
    • Check the Phone and Tablet option if you are going to create app for mobile and Tab
  • Add an activity to Mobile : slect an empty activity template
  • Name your activity and layout file
  • Click on finish Button (it will take some time to finish the Gradle Build)

Create XML Layouy File


  • Click on the Project Tab to open the project files
  • Navigate to app > res > layout > activity_main.xml in project column
  • nothing to change with it

  • Create JAVA Activity File


  • Click on the Project Tab to open the project files
  • Navigate to app > java > Package Name > MainActivity.java in project column
  • this code will be the default

  • Add ITelephony.AIDL file


  • create an AIDL folder
  • create a new package in AIDL folder name must be com.android.internal.telephony
  • create an AIDL file in that package name must be the ITelephony.aidl
  • add that code in ITelephony.aidl

  • Create BroadcastReceiver Class


  • now its time to block all incomming calls
  • Create a a BroadcastReceiver class
  • add that code to the class

  • Run App


  • Start Emulator by clicking on the AVD Manager
  • Start Emulator
  • Click on the RUN icon or press SHIFT + F10
  • All the incomming calls will be blocked
  • Comments

    Popular posts from this blog

    Radio Buttons Tutorial - Android Studio Tutorials

    Toggle Buttons Tutorial - Android Studio Tutorials