An Android application that demonstrates SMS monitoring and data synchronization capabilities for educational and portfolio purposes.
This project is for educational and portfolio purposes only. It demonstrates Android development concepts including background services, content observers, and data synchronization. Please ensure compliance with local laws and regulations when handling SMS data.
Content Observer Service is an Android application that monitors incoming and outgoing SMS messages, stores them in a local SQLite database cache, and synchronizes the data when network connectivity is available. The application showcases various Android development patterns including:
- Background service implementation
- Content observer for SMS monitoring
- SQLite database management
- Network state monitoring
- Email integration for data transmission
- Permission handling for modern Android versions
- SMS Monitoring: Automatically captures incoming and outgoing SMS messages
- Local Caching: Stores SMS data in SQLite database for offline access
- Smart Synchronization: Sends cached data only when:
- Network connectivity is available
- Cache reaches a specified number of rows
- Background Processing: Runs as a foreground service for reliable operation
- Boot Persistence: Automatically starts after device reboot
- Modern Permissions: Handles Android 13+ notification permissions and Android 14+ foreground service requirements
- Minimum SDK: Android 10 (API 29)
- Target SDK: Android 15 (API 35)
- Build Tools: 30.0.3
ContentObserverService: Main foreground service handling SMS monitoringBootBroadcastReceiver: Ensures service starts after device reboot
ContentActivity: Main application interfacePermissionActivity: Handles runtime permission requests
SmsListener: Monitors SMS content changesSmsCache: Manages SQLite database operationsSmsContentFilter: Filters and processes SMS data
NetworkUtil: Network connectivity monitoringPermissionHelper: Runtime permission managementPhoneInformationDeliverer: Device information collectionMailComposer: Email integration for data transmission
The application requires several permissions to function properly:
- SMS Permissions:
RECEIVE_SMS,READ_SMS,SEND_SMS - Network Permissions:
INTERNET,ACCESS_NETWORK_STATE - Phone State:
READ_PHONE_STATE,READ_PHONE_NUMBERS - Contacts:
READ_CONTACTS - System:
RECEIVE_BOOT_COMPLETED - Storage:
WRITE_EXTERNAL_STORAGE,READ_EXTERNAL_STORAGE(Android 10-13) - Notifications:
POST_NOTIFICATIONS(Android 13+) - Foreground Service:
FOREGROUND_SERVICE,FOREGROUND_SERVICE_DATA_SYNC(Android 14+)
- AndroidX Core: 1.12.0
- AndroidX AppCompat: 1.6.1
- JavaMail: For email functionality
- Apache Commons Net: For network utilities
-
Clone the repository:
git clone <repository-url> cd ContentObserverService
-
Open in Android Studio:
- Import the project
- Sync Gradle files
- Ensure Android SDK 29+ is installed
-
Configure Email Settings:
- Update
values.xmlwith valid email credentials - Configure SMTP settings for data transmission
- Update
-
Build and Install:
./gradlew assembleDebug
- Install the application on an Android device
- Grant required permissions when prompted
- Configure email settings in the application
- The service will automatically start monitoring SMS messages
- Cached data will be synchronized when network conditions are met
The application follows a modular architecture with clear separation of concerns:
app/src/main/java/system/widget/
├── ContentObserverService.java # Main service
├── ContentActivity.java # Main UI
├── PermissionActivity.java # Permission handling
├── BootBroadcastReceiver.java # Boot receiver
├── mail/ # Email functionality
├── SmsContent/ # SMS processing
└── utils/ # Utility classes
- Local Storage: All SMS data is stored locally in SQLite
- Encrypted Transmission: Email transmission uses secure protocols
- Permission Management: Implements proper runtime permission handling
- Data Minimization: Only necessary data is collected and transmitted
This project is licensed under the GNU General Public License v3.0. See the LICENSE.txt file for details.
Rafał Stańczuk
Email: stanczuk.rafal@gmail.com
Repository: https://github.com/rafalstanczuk/contentobserverservice
- OAuth integration for enhanced security
- Cloud storage integration
- Advanced filtering options
- Data encryption improvements
- Modern UI/UX design
This is an educational project. Contributions are welcome for learning purposes. Please ensure any modifications maintain the educational nature of the project.
- This application requires significant permissions that may trigger security warnings
- SMS monitoring capabilities should be used responsibly and in compliance with local laws
- The application is designed for educational purposes and should not be used for malicious activities
- Always respect user privacy and data protection regulations