Development Setup¶
This guide walks you through setting up your development environment for OpenTransition.
Step 1: Install Android Studio¶
- Download Android Studio for your platform
- Run the installer and follow the setup wizard
- Install the Android SDK and necessary build tools
SDK Setup
During installation, ensure you install:
- Android SDK Platform 36
- Android SDK Build-Tools
- Android Emulator
- Android SDK Platform-Tools
Step 2: Install Java Development Kit (JDK)¶
OpenTransition requires JDK 17.
Option 1: Install via Android Studio¶
Android Studio includes a JDK. You can use it by configuring your project to use the embedded JDK.
Option 2: Install Separately¶
Verify installation:
Step 3: Clone the Repository¶
Step 4: Set Up Firebase¶
OpenTransition uses Firebase for authentication, cloud storage, analytics, and crash reporting.
Create a Firebase Project¶
- Go to Firebase Console
- Click "Add project" or "Create a project"
- Enter a project name (e.g., "OpenTransition Dev")
- Follow the setup wizard (Analytics is optional for development)
Add Android App to Firebase¶
- In the Firebase Console, click "Add app" and select Android
- Package name:
com.shelbeely.opentransition - App nickname: Optional (e.g., "OpenTransition Android")
- Debug signing certificate SHA-1: Optional for development
- Click "Register app"
Download Configuration File¶
- Download the
google-services.jsonfile - Place it in the
mobile/directory of your project:
Security Note
The google-services.json file contains sensitive API keys and should never be committed to version control. It's already listed in .gitignore.
Enable Firebase Services¶
Enable the following services in your Firebase project:
- Authentication
- Go to Authentication > Sign-in method
- Enable "Email/Password"
-
Enable "Google" sign-in
-
Firestore Database
- Go to Firestore Database
- Click "Create database"
- Start in test mode for development
-
Choose a location close to your users
-
Crashlytics (Optional for development)
- Go to Crashlytics
-
Click "Enable Crashlytics"
-
Analytics (Optional for development)
- Automatically enabled when you create the project
Step 5: Configure Secrets¶
OpenTransition uses a secrets.properties file for sensitive configuration.
-
Copy the example file:
-
Open
secrets.propertiesand configure the values:
# Firebase AdMob App ID (use test ID for development)
ADS_APP_ID=ca-app-pub-3940256099942544~3347511713
# AdMob Ad Unit IDs (test IDs for development)
ADS_GALLERY_AD_ID=ca-app-pub-3940256099942544/9214589741
ADS_HOME_AD_ID=ca-app-pub-3940256099942544/9214589741
ADS_MILESTONES_AD_ID=ca-app-pub-3940256099942544/9214589741
ADS_SETTINGS_AD_ID=ca-app-pub-3940256099942544/9214589741
# Security salt for PIN/Pattern hashing (generate a random string)
CODE_SALT=your_random_salt_string_here_change_this
Generating CODE_SALT
Generate a secure random string for CODE_SALT:
Production Values
The example values are test/development values. Never use them in production. Get your own AdMob IDs from AdMob Console.
Step 6: Open Project in Android Studio¶
- Launch Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned
OpenTransitiondirectory - Click "OK"
Android Studio will: - Import the Gradle project - Download dependencies - Index the project files
This may take several minutes on the first run.
Step 7: Sync Gradle¶
Once the project is opened:
- Click "Sync Project with Gradle Files" button (or File > Sync Project with Gradle Files)
- Wait for the sync to complete
- Resolve any errors that appear
Common Sync Issues
- Missing google-services.json: Ensure the file is in
mobile/directory - Missing secrets.properties: Ensure you copied and configured it
- SDK not found: Install the required SDK version (36) in SDK Manager
Step 8: Configure an Android Virtual Device (AVD)¶
If you don't have a physical Android device:
- Open AVD Manager (Tools > Device Manager)
- Click "Create Virtual Device"
- Select a device definition (e.g., Pixel 5)
- Select a system image (API 34 or higher recommended)
- Click "Finish"
Step 9: Build and Run¶
Using Android Studio¶
- Select your device/emulator from the device dropdown
- Click the "Run" button (green play icon) or press
Shift + F10 - Wait for the build to complete and the app to launch
Using Command Line¶
# Debug build
./gradlew assembleDebug
# Install on connected device
./gradlew installDebug
# Run tests
./gradlew test
# Build and run
./gradlew build
Verify Your Setup¶
If everything is configured correctly:
- The app builds without errors
- The app launches on your device/emulator
- You can create an account or sign in
- You can navigate through the app
Troubleshooting¶
Build Fails with "google-services.json missing"¶
Solution: Ensure google-services.json is in the mobile/ directory.
Build Fails with "secrets.properties not found"¶
Solution: Copy secrets.properties.example to secrets.properties and configure it.
Gradle Sync Issues¶
Solution:
SDK Licenses Not Accepted¶
Solution:
Firebase Authentication Doesn't Work¶
Solution:
- Verify google-services.json is correct
- Check Firebase Console for enabled authentication methods
- Ensure app package name matches: com.shelbeely.opentransition
Next Steps¶
Now that your environment is set up, learn how to build the app:
Additional Configuration¶
Debug Keystore¶
For development, the project uses a debug keystore located at keys/debug-keystore.jks. This is included in the repository for development convenience.
Credentials:
- Store Password: debugkey
- Key Alias: transtracks
- Key Password: debugkey
Production Keystore
Never commit your production keystore to version control. Use environment variables or secure secret management for production releases.
ProGuard Configuration¶
The release build uses ProGuard for code obfuscation and optimization. The rules are defined in mobile/proguard-rules.pro.
For development, ProGuard is disabled in debug builds for faster build times.