Skip to content

rupaksahu371/CallBlocker

Repository files navigation

📵 Call Blocker — Android App

Block incoming calls by exact number, prefix pattern, or wildcard.


Features

  • ✅ Block exact numbers (e.g. +919876543210)
  • ✅ Block by prefix with wildcard (e.g. +9111* blocks ALL numbers starting with +9111)
  • ✅ Multi-wildcard patterns (e.g. +91*800* blocks any +91 number containing 800)
  • ✅ Bulk import — paste many rules at once
  • ✅ Long-press any rule to delete it
  • ✅ Uses Android's official CallScreeningService API (Android 10+)
  • ✅ Blocked calls still appear in call log (so you can see them)

How to Build & Install

Requirements

  • Android Studio Hedgehog (2023.1.1) or newer
  • Android SDK 34
  • A physical Android device running Android 10+ (API 29+)

Steps

  1. Open Android Studio → File → Open → select the CallBlocker folder
  2. Let Gradle sync finish
  3. Connect your Android phone via USB (enable USB Debugging in Developer Options)
  4. Click Run ▶ or press Shift+F10

First Time Setup (on the phone)

  1. Open the app
  2. Tap "⚙️ Activate as Call Screener"
  3. In the system dialog, select "Call Blocker" as your call screener → tap Allow
  4. Status should change to 🟢 Active

⚠️ Android only allows one call screening app at a time. If you use Google Phone app's spam filtering, this will replace it. You can switch back anytime.


Adding Blocking Rules

Tap the ➕ FAB button to add a single rule, or Bulk Add to paste multiple.

Rule Format Examples

Rule What it blocks
+919876543210 Only that exact number
+9111* All numbers starting with +9111
+91211* All numbers starting with +91211
+911800* Toll-free numbers starting with +911800
+91* ALL +91 numbers (use with caution!)
+91*spam* Any +91 number containing "spam"

Wildcard Rules

  • * matches zero or more of any character
  • Can be placed anywhere in the pattern
  • No need to escape + or digits

How It Works

The app uses Android's CallScreeningService API:

  • When a call comes in, Android asks this app: "Should I allow this call?"
  • The app checks the number against your saved rules
  • If a rule matches → call is silently rejected (caller hears busy/disconnected)
  • If no rule matches → call rings normally

The blocking happens before the phone rings — no sound, no vibration.


Permissions Required

Permission Why
READ_PHONE_STATE To read incoming call details
ANSWER_PHONE_CALLS Required to reject calls programmatically
READ_CALL_LOG For logging blocked calls
CALL_PHONE Required by the screening service

Minimum Requirements

  • Android 10 (API 29) or higher
  • The CallScreeningService role must be granted

Troubleshooting

"Blocking isn't working" → Make sure status shows 🟢 Active. If not, tap Activate again.

"I can't find the app in the role dialog" → Restart the app and try Activate again. Some ROMs require a reboot after install.

"Calls from blocked numbers still ring" → Another app (like Google Phone) may have taken over as screener. Go to Phone app settings → Caller ID & Spam, and disable it.


File Structure

CallBlocker/
├── app/src/main/
│   ├── java/com/callblocker/
│   │   ├── MainActivity.java          ← UI, rule management
│   │   └── CallScreeningService.java  ← Core blocking logic
│   ├── res/
│   │   ├── layout/
│   │   │   ├── activity_main.xml
│   │   │   ├── dialog_add_rule.xml
│   │   │   └── dialog_bulk_add.xml
│   │   └── values/
│   │       ├── colors.xml
│   │       ├── strings.xml
│   │       └── themes.xml
│   └── AndroidManifest.xml
├── app/build.gradle
└── build.gradle

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages