Skip to content

pranav-wakode/network-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ก Network Monitor Android App

A native Android application that continuously monitors and displays cellular network type (4G/5G) with real-time notifications and alerts.

โœจ Features

โš™๏ธ Core Functionality

  • Real-time Network Detection: Continuously monitors cellular network type using Android's TelephonyManager API

Network information

  • 4G/5G Detection: Accurately identifies 4G LTE and 5G networks (including 5G NSA where applicable)

Network status 4G ย ย ย ย ย ย Network status 5G

  • Persistent Notification: Always-visible notification banner showing current network status

Persistent notification

  • Network Change Alerts: Instant notifications when switching between 4G and 5G networks

Switched to 4G pop-up ย ย ย ย ย ย Switched to 5G pop-up

  • User Controls: Easy toggle to enable/disable monitoring with settings for sound and vibration alerts

Network status 4G

๐Ÿ› ๏ธ Technical Implementation

  • Foreground Service: Ensures continuous monitoring even when app is in background
  • PhoneStateListener: Real-time callbacks for network state changes
  • Battery Efficient: Uses system callbacks instead of polling to minimize battery usage
  • Permission Handling: Graceful requesting and handling of required permissions
  • Android 10+ Support: Compatible with modern Android versions supporting 5G APIs

๐Ÿ“ฑ User Interface

  • Clean Material Design: Modern, intuitive interface with clear status displays
  • Real-time Updates: Live display of network type, carrier, and signal strength
  • Settings Panel: Configure alert preferences (sound/vibration)
  • Quick Controls: Toggle monitoring directly from notification or main app

๐Ÿ”‘ Permissions Required

The app requests the following permissions:

  • READ_PHONE_STATE: To detect cellular network type and carrier information
  • ACCESS_NETWORK_STATE: To monitor network connectivity status
  • ACCESS_WIFI_STATE: To detect WiFi connections
  • FOREGROUND_SERVICE: To run continuous monitoring service
  • POST_NOTIFICATIONS: To show persistent notifications and alerts (Android 13+)
  • VIBRATE: For vibration alerts when network changes

๐Ÿ›๏ธ Architecture

๐Ÿ“ฆ Main Components

  1. MainActivity: Primary UI interface with network status display and controls
  2. NetworkMonitorService: Foreground service handling continuous network monitoring
  3. NetworkStateListener: PhoneStateListener implementation for real-time network changes
  4. NotificationHelper: Manages persistent notifications and network change alerts
  5. BootCompleteReceiver: Auto-starts monitoring after device reboot (if previously enabled)

๐Ÿ—๏ธ Service Architecture

  • Service runs as foreground service with persistent notification
  • Uses TelephonyManager for accurate network type detection
  • Implements PhoneStateListener for real-time change detection
  • Supports quick toggle actions directly from notification

๐ŸŒ Network Type Detection

The app accurately identifies:

  • 2G Networks: GPRS, EDGE, CDMA, 1xRTT
  • 3G Networks: UMTS, EVDO variants, HSDPA, HSUPA, HSPA, HSPA+
  • 4G Networks: LTE (Long Term Evolution)
  • 5G Networks: 5G NR (New Radio), including NSA (Non-Standalone) detection
  • WiFi Connections: Separate handling for WiFi connectivity

๐Ÿ“ถ 5G Detection Methods

  1. Direct network type detection using NETWORK_TYPE_NR (Android 10+)
  2. ServiceState analysis for 5G NSA connections
  3. Fallback detection for various 5G deployment scenarios

๐Ÿ”‹ Battery Optimization

The app follows Android best practices for battery efficiency:

  • Uses system callbacks instead of polling
  • Foreground service ensures system doesn't kill monitoring
  • Minimal CPU usage with event-driven architecture
  • Proper service lifecycle management

๐Ÿ“ Installation Requirements

  • Minimum Android Version: Android 10 (API level 29)
  • Target Android Version: Android 14 (API level 34)
  • Hardware Requirements: Device with cellular capability
  • Network Requirements: Active cellular connection for full functionality

๐Ÿ“œ Usage Instructions

  1. Install and Launch: Install the app and grant required permissions
  2. Enable Monitoring: Toggle the monitoring switch in main interface
  3. Configure Alerts: Set preferences for sound and vibration alerts
  4. Background Operation: App continues monitoring when in background
  5. Quick Controls: Use notification actions to toggle monitoring
  6. Network Changes: Receive alerts when switching between 4G and 5G

๐Ÿง‘โ€๐Ÿ”ง Development Notes

  • Built with Java for maximum compatibility
  • Uses official Android SDK APIs only (no third-party dependencies)
  • Follows Material Design guidelines
  • Implements proper permission handling for all Android versions
  • Comprehensive error handling and logging

๐Ÿ›ก๏ธ Compliance and Security

  • Uses only official Android APIs
  • No paid or third-party services required
  • Respects user privacy with minimal permission requests
  • Follows Android security best practices
  • No data collection or external network communication

๐Ÿ—“๏ธ Future Enhancements

  • Data usage monitoring and alerts
  • Network speed testing integration
  • Historical network type logging
  • Advanced 5G feature detection (mmWave, sub-6GHz)
  • Battery usage optimization metrics

About

A lightweight, native Android application that continuously monitors network types (4G LTE/5G NR) and sends real-time alerts on connectivity changes. Built with Java & Android Telephony API. ๐Ÿ“ถโšก

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages