A secure, efficient SMS relay mobile application that receives SMS requests via Firebase Cloud Messaging and forwards them automatically. Perfect for SMS forwarding services.
✅ One-Time Login - Secure email/password authentication
✅ Firebase Integration - Real-time SMS delivery via FCM (no polling)
✅ SMS Management - Local database tracking of all SMS (sent/failed/pending)
✅ Beautiful UI - Material Design 3 with modern layouts
✅ Offline Support - Works without active internet (buffering capability)
✅ Security - Encrypted authentication tokens, secure API communication
✅ Production Ready - Error handling, logging, crash reporting setup
✅ Zero Polling - Event-driven architecture using Firebase
Splash Screen (Check Login)
↓
[Logged Out?] → Login Activity → Server Authentication → FCM Token Register
↓
[Logged In?] → Dashboard Activity (Main)
↓
← Receives SMS via Firebase Cloud Messaging
← Auto-sends SMS to recipient
← Stores record in local database
← Updates server with status
Dashboard Features:
- Welcome message with user email
- Total sent/failed SMS count
- Recent SMS list (3 items)
- View full SMS history button
- Logout button
SMS Status Activity:
- Filter by All/Sent/Failed
- Full SMS history with timestamps
- Message content preview
- Recipient numbers
- Status indicators
app/
├── auth/
│ ├── AuthManager.kt (Authentication logic)
│ └── LoginActivity.kt (Login UI)
├── core/
│ ├── AppConstants.kt (Constants)
│ ├── AppUtils.kt (Utility functions)
│ └── DeviceInfo.kt (Device information)
├── data/
│ ├── database/
│ │ ├── AppDatabase.kt (Room database)
│ │ └── SmsDao.kt (Data access objects)
│ ├── entity/
│ │ └── SmsEntity.kt (Database entity)
│ ├── model/
│ │ ├── SmsRecord.kt (Domain model)
│ │ └── User.kt (User model)
│ └── repository/
│ └── SmsRepository.kt (Data repository)
├── fcm/
│ ├── FcmManager.kt (FCM management)
│ └── MyFirebaseService.kt (FCM message handling)
├── network/
│ ├── ApiClient.kt (Retrofit setup)
│ ├── ApiService.kt (API endpoints)
│ └── NetworkManager.kt (Network operations)
├── sms/
│ ├── SmsManager.kt (SMS sending logic)
│ └── SmsStatusReceiver.kt (SMS delivery reports)
├── storage/
│ └── StorageManager.kt (SharedPreferences wrapper)
├── ui/
│ ├── BaseActivity.kt (Base activity class)
│ ├── DashboardActivity.kt (Main dashboard)
│ ├── SmsStatusActivity.kt (SMS history view)
│ ├── SmsAdapter.kt (RecyclerView adapter)
│ └── SplashActivity.kt (Splash screen)
└── SmsRelayApp.kt (Application class)
res/
├── layout/
│ ├── activity_splash.xml
│ ├── activity_login.xml
│ ├── activity_dashboard.xml
│ ├── activity_sms_status.xml
│ └── item_sms.xml
└── values/
├── colors.xml
├── dimens.xml
├── strings.xml
└── themes.xml
git clone <repository-url>
cd smsrelay
open build.gradle.kts in Android Studio- Go to Firebase Console
- Create a new project (or select existing)
- Add Android app with package:
site.stackverify.smsrelay - Download
google-services.json - Place it in:
app/google-services.json - Enable Firebase Cloud Messaging in console
# Build the project
./gradlew build
# Run on emulator or device
./gradlew installDebugUpdate API endpoints in AppConstants.kt:
const val BASE_URL = "https://your-api.com/api/"Required API Endpoints:
Request:
{
"email": "user@example.com",
"password": "password123",
"appId": "APP_Manufacturer_Model_Timestamp",
"fcmToken": "FCM_TOKEN_HERE"
}Response:
{
"success": true,
"token": "JWT_TOKEN",
"message": "Login successful",
"userId": "USER_ID"
}Request:
{
"fcmToken": "FCM_TOKEN"
}Response:
{
"success": true
}Request:
{
"smsId": "SMS_ID_FROM_FCM",
"status": "sent|failed|pending",
"timestamp": 1234567890
}Response:
{
"success": true,
"message": "Status updated"
}Send FCM messages to topic all_devices with this structure:
{
"data": {
"action": "send_sms",
"smsId": "UNIQUE_ID",
"number": "+1234567890",
"message": "Hello World"
}
}Or for notifications:
{
"data": {
"action": "notification",
"title": "SMS Relay",
"body": "Message forwarded successfully",
"id": "NOTIFICATION_ID"
}
}- Android Core: AndroidX, Material Design 3
- Networking: Retrofit 2, OkHttp 3, Gson
- Database: Room, Coroutines
- Firebase: Cloud Messaging, Analytics, Crashlytics
- Logging: Timber
- Kotlin: Coroutines, Extensions
- Token-based Authentication - JWT tokens saved securely
- HTTPS Only - No cleartext traffic in production
- App Signing - Google Play App Signing enabled
- ProGuard Obfuscation - Code protection enabled
- Encrypted Storage - SharedPreferences + EncryptedSharedPreferences
- Permission Management - Minimal permissions requested
- Crash Reporting - Firebase Crashlytics integration
SEND_SMS- To send SMS messagesREAD_PHONE_STATE- To detect phone stateINTERNET- Network communicationACCESS_NETWORK_STATE- Network availability checkWAKE_LOCK- FCM background processing
The app uses Timber for comprehensive logging:
Timber.d("Debug message")
Timber.e(exception, "Error message")
Timber.w("Warning message")In production build, only errors are logged. Debug logs are suppressed.
The app handles:
- Network failures gracefully
- Invalid credentials
- Missing permissions
- Firebase connection issues
- Database errors
- SMS sending failures
All errors are logged and reported to crash analytics.
The app is structured for easy unit and integration testing:
- Dependency injection ready
- Repository pattern for data access
- Separate concerns (auth, network, storage, SMS)
- Update API base URL
- Configure Firebase project
- Download google-services.json
- Set up backend API endpoints
- Enable Firebase Crashlytics
- Configure analytics
- Create signing key for Play Store
- Set up ProGuard/R8
- Test on real devices
- Load test FCM delivery
- Enable backup and restore
- Test offline functionality
- Efficient Database Queries - Indexed searches
- Coroutine-based Async - Non-blocking operations
- Lazy Loading - RecyclerView pagination ready
- Memory Management - Proper lifecycle handling
- Network Optimization - Connection pooling, timeout management
- Check Firebase Cloud Messaging is enabled
- Verify app is subscribed to topic
- Check internet connectivity
- Review logcat for errors
- Verify SMS permission granted
- Check phone has SMS capability
- Verify recipient number format
- Check device has cellular/active SIM
- Verify API endpoint is correct
- Check email/password credentials
- Ensure network connectivity
- Check Firebase token generation
- Check logcat/Crashlytics reports
- Verify all dependencies installed
- Check for null pointer exceptions
- Review error logs in Timber
- v1.0.0 - Initial production release
- Complete auth flow
- SMS handling via FCM
- SMS history tracking
- Beautiful Material Design UI
- Production-ready error handling
Proprietary - SMS Relay Service
For support, contact: support@stackverify.site
Made with ❤️ for secure SMS relay service