mirror of
https://github.com/vernu/textbee.git
synced 2026-06-11 01:09:42 -04:00
Adds a full parallel Jetpack Compose UI alongside the legacy Java/XML app. Users can switch between UIs via Settings; SplashActivity routes on launch. New screens: - Onboarding wizard (QR/manual API key, device registration, permissions) - Dashboard (device status, all-time stats, subscription card, quick actions) - Messages tab (SMS history with filter chips, pagination, detail dialog) - Compose screen (multi-recipient input, send with snackbar feedback) - Settings (account, gateway, SMS, legal, system, about sections) - Splash screen with textbee logo and routing logic Infrastructure: - Compose BOM 2023.08.00, Material3, Navigation Compose, Kotlin coroutines - GatewayApiServiceKt (suspend Retrofit interface) + ApiManagerKt singleton - Kotlin DTOs for stats, subscription, user profile, messages, send SMS - Material3 theme with brand orange, dark mode safe (dynamicColor = false) Also adds MIGRATION.md tracking what's done vs what remains to port. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.4 KiB
3.4 KiB
Android Build Variants Setup (Dev vs Prod)
This document explains how to use the dev and prod build variants for the SMS Gateway Android app.
Overview
The app now supports two build variants:
- Dev: For development and testing
- Prod: For production releases
Key Differences
| Feature | Dev | Prod |
|---|---|---|
| Package Name | com.vernu.sms.dev |
com.vernu.sms |
| App Name | "SMS Gateway (Dev)" | "SMS Gateway" |
| API Base URL | https://api-dev.textbee.dev/api/v1/ |
https://api.textbee.dev/api/v1/ |
| Firebase Config | app/src/dev/google-services.json |
app/src/prod/google-services.json |
| Version Suffix | -dev appended |
No suffix |
Setup Instructions
1. Firebase Configuration
For Production:
- The current
google-services.jsonhas been moved toapp/src/prod/google-services.json - No changes needed if you're already using the production Firebase project
For Development:
- Create a new Firebase project for development
- Download the
google-services.jsonfor your dev project - Important: Make sure the package name in Firebase is set to
com.vernu.sms.dev - Replace the template file at
app/src/dev/google-services.jsonwith your actual dev configuration
2. API Configuration
The API base URLs are now configured via build variants:
- Dev:
https://api-dev.textbee.dev/api/v1/ - Prod:
https://api.textbee.dev/api/v1/
To change the dev API URL, edit the buildConfigField in app/build.gradle:
dev {
buildConfigField "String", "API_BASE_URL", '"https://api-dev.textbee.dev/api/v1/"'
}
Building the App
Using Android Studio:
- Open the "Build Variants" panel (View → Tool Windows → Build Variants)
- Select the desired variant:
devDebug- Development build for debuggingdevRelease- Development release buildprodDebug- Production build for debuggingprodRelease- Production release build
Using Command Line:
# Build dev debug
./gradlew assembleDevDebug
# Build dev release
./gradlew assembleDevRelease
# Build prod debug
./gradlew assembleProdDebug
# Build prod release
./gradlew assembleProdRelease
Installation
Both variants can be installed simultaneously on the same device since they have different package names:
- Dev app will show as "SMS Gateway (Dev)"
- Prod app will show as "SMS Gateway"
Environment Detection
You can detect which environment the app is running in using:
if (BuildConfig.ENVIRONMENT.equals("development")) {
// Development-specific code
} else {
// Production code
}
Important Notes
- Different Package Names: Dev and prod apps are completely separate and can coexist
- Separate Data: Each variant maintains its own app data and preferences
- Firebase Projects: Use separate Firebase projects for dev and prod
- API Endpoints: Ensure your backend has corresponding dev/prod endpoints
- Testing: Always test the prod build before releasing
Troubleshooting
Build Errors:
- Ensure both
google-services.jsonfiles are properly configured - Check that package names match between Firebase console and app configuration
- Verify API URLs are accessible
Firebase Issues:
- Confirm the package name in Firebase matches the variant (
com.vernu.sms.devfor dev) - Ensure SHA-1 fingerprints are added to Firebase if using authentication