SMSForwarder is an Android application that automatically forwards incoming SMS messages to a specified email address. It runs as a background service and provides a user interface for configuration and log viewing.
- Automatic SMS forwarding to email
- Background service for continuous operation
- User interface for configuration
- Log viewing capability
- Service start/stop functionality
MainActivity
: The main entry point of the application, handling UI and user interactions.SmsForwarderService
: A foreground service that listens for incoming SMS messages.SmsReceiver
: A BroadcastReceiver that intercepts incoming SMS messages.LogActivity
: An activity to display the forwarding logs.SmsLog
: A data class and associated database operations for storing log entries.
activity_main.xml
: Layout for the main configuration screen.activity_log.xml
: Layout for the log viewing screen.
- Room database for storing log entries.
- Jetpack Compose theme components for consistent UI styling.
app/build.gradle.kts
: Contains project dependencies and Android configuration.app/src/main/AndroidManifest.xml
: Declares app components and permissions.app/src/main/java/com/apropos/smsforwarder/MainActivity.kt
: Main activity code.app/src/main/java/com/apropos/smsforwarder/SmsForwarderService.kt
: Background service code.app/src/main/java/com/apropos/smsforwarder/SmsReceiver.kt
: SMS interception code.app/src/main/java/com/apropos/smsforwarder/LogActivity.kt
: Log viewing activity code.app/src/main/java/com/apropos/smsforwarder/SmsLog.kt
: Log data and database operations.app/src/main/java/com/apropos/smsforwarder/ui/theme/
: Jetpack Compose theme files.
- Clone the repository.
- Open the project in Android Studio.
- Sync the project with Gradle files.
- Build and run the application on an Android device or emulator.
The project includes both unit tests and instrumented tests:
- Unit tests: Located in
app/src/test/java/com/apropos/smsforwarder/
- Instrumented tests: Located in
app/src/androidTest/java/com/apropos/smsforwarder/
To run tests:
- For unit tests:
./gradlew test
- For instrumented tests:
./gradlew connectedAndroidTest
The app requires the following permissions:
RECEIVE_SMS
: To intercept incoming SMS messages.INTERNET
: To send emails.FOREGROUND_SERVICE
: To run as a foreground service.NOTIFICATION
: To forcibly enable notifications.
- Ensure proper error handling and user notifications for failed forwarding attempts.
- Follow Android best practices for background services and battery optimization.
- Implement message filtering options.
- Add support for MMS forwarding.
- Create a widget for quick service toggling.
- Add support for multiple email recipients.