An Android application that identifies unknown callers in real time by querying the nieznany-numer.pl database. When a call comes in, a draggable overlay displays the caller's community rating, search history, and user comments, with a one-tap option to reject negatively-rated calls.
- Real-time caller identification via BroadcastReceiver that intercepts
PHONE_STATEintents when the phone rings - Floating overlay displayed on top of other apps, showing caller number, rating badge, and details while the phone is ringing
- Community ratings with color-coded badges: positive (green), neutral (yellow), negative (red), and unknown (gray)
- One-tap call rejection button that appears automatically for negatively-rated numbers, using TelecomManager on Android P+ with legacy reflection fallback
- Draggable overlay that can be repositioned by touch during an active call
- Persistent notification keeping the service alive in the background
- Multi-language support with localized strings for English, Polish, French, and Russian
- API integration fetching rating counts, search history, comment count, last-searched date, and user comments from the backend
The app follows a receiver-service-provider pattern:
- PhoneStateReceiver -- A
BroadcastReceiverregistered forandroid.intent.action.PHONE_STATE. OnRINGING, it extracts the incoming number and startsOverlayService. OnIDLEorOFFHOOK, it stops the service. - OverlayService -- Creates a
TYPE_APPLICATION_OVERLAYwindow with the caller info layout. Handles drag gestures, close/reject buttons, and manages the overlay lifecycle. - PhoneNumberProvider -- Performs an asynchronous HTTP GET to the API endpoint, parses the JSON response, and delivers rating, counts, and comments via a callback interface.
- MainActivity -- Handles permission requests (phone state, call log, overlay, answer calls), creates the notification channel, and shows a persistent notification.
| Library | Version | Purpose |
|---|---|---|
| AndroidX AppCompat | 1.7.1 | Backward-compatible Activity and UI components |
| Material Components | 1.13.0 | Material Design theming |
| ConstraintLayout | 2.2.1 | Flexible layout manager |
| JUnit | 4.13.2 | Unit testing |
| Espresso | 3.7.0 | UI testing |
| Permission | Purpose |
|---|---|
INTERNET |
Query the phone number lookup API |
READ_PHONE_STATE |
Detect incoming calls |
READ_CALL_LOG |
Access caller number on Android 9+ |
READ_PHONE_NUMBERS |
Read phone number details |
SYSTEM_ALERT_WINDOW |
Display overlay on top of other apps |
ANSWER_PHONE_CALLS |
Reject calls programmatically (Android 9+) |
- Android Studio (Arctic Fox or later)
- JDK 8+
- Android SDK with API level 36
git clone <repository-url>
cd CallerIDOpen the project in Android Studio, sync Gradle, and run on a device or emulator.
Alternatively, build from the command line:
./gradlew assembleDebugThe APK will be located at app/build/outputs/apk/debug/.
CallerID/
├── app/
│ ├── build.gradle # App-level build configuration
│ ├── proguard-rules.pro # ProGuard rules
│ └── src/
│ ├── main/
│ │ ├── AndroidManifest.xml # Permissions, receiver, service declarations
│ │ ├── java/com/example/nieznany_numer/
│ │ │ ├── MainActivity.java # Entry point, permissions, notification channel
│ │ │ ├── PhoneStateReceiver.java # BroadcastReceiver for call state changes
│ │ │ ├── OverlayService.java # Floating window with caller info and controls
│ │ │ ├── PhoneNumberProvider.java # Async API client for number lookup
│ │ │ └── Notification.java # Notification activity
│ │ └── res/
│ │ ├── layout/
│ │ │ ├── activity_main.xml # Main activity layout
│ │ │ ├── overlay_caller.xml # Floating overlay layout
│ │ │ └── notification.xml # Notification layout
│ │ ├── drawable/ # Rating badges and overlay backgrounds
│ │ ├── values/ # Default strings and themes
│ │ ├── values-en/ # English localization
│ │ ├── values-pl/ # Polish localization
│ │ ├── values-fr/ # French localization
│ │ └── values-ru/ # Russian localization
│ └── test/ # Unit tests
├── settings.gradle
└── README.md
The API endpoint is defined in PhoneNumberProvider.java:
private static final String API_BASE = "https://your-server.com/api/v1/numbers/";Replace this URL with your own backend or a compatible phone number lookup API before building.
This project is provided as-is for educational purposes.

