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


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

  4. Create JAVA Activity File


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

  8. Add ITelephony.AIDL file


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

  13. Create BroadcastReceiver Class


  14. now its time to block all incomming calls
  15. Create a a BroadcastReceiver class
  16. add that code to the class

  17. Run App


  18. Start Emulator by clicking on the AVD Manager
  19. Start Emulator
  20. Click on the RUN icon or press SHIFT + F10
  21. All the incomming calls will be blocked
  22. Comments

    Popular posts from this blog

    Radio Buttons Tutorial - Android Studio Tutorials

    Toggle Buttons Tutorial - Android Studio Tutorials