Building the Application
Using Android Studio
Select Build Variant
In the Build Variants panel (usually on the left side), select either:
- debug - for development builds with debugging enabled
- release - for production builds (requires signing configuration)
Using Gradle Command Line
You can also build the project using Gradle from the command line:- Debug:
app/build/outputs/apk/debug/app-debug.apk - Release:
app/build/outputs/apk/release/app-release.apk
Running on an Emulator
Create an Android Virtual Device (AVD)
Select System Image
Choose a system image with API level 23 or higher (MorseIt’s minimum SDK):
- API 28 (Android 9.0 Pie) - recommended for testing
- API 23 (Android 6.0 Marshmallow) - for testing minimum requirements
Launch the App on Emulator
Start the Emulator
In the AVD Manager, click the play button next to your virtual device to launch it.
Select Device in Android Studio
Once the emulator is running, select it from the device dropdown in the toolbar.
The first launch may take a few minutes as the emulator boots up and the app is installed.
Running on a Physical Device
Enable Developer Options
Enable Developer Mode
On your Android device, go to Settings > About Phone and tap Build Number 7 times.
Deploy to Device
Verify Device Connection
Your device should appear in the device dropdown in Android Studio’s toolbar.
Verify Device Connection (Command Line)
You can verify that your device is connected using ADB:Running Tests
MorseIt includes unit tests and instrumented tests.Unit Tests
Run unit tests from the command line:app/src/test/java and select Run Tests.
Instrumented Tests
Run instrumented tests (requires a connected device or emulator):app/src/androidTest/java and select Run Tests.
Common Issues and Solutions
Gradle Sync Failed
Gradle Sync Failed
Solution: Check your internet connection and ensure you have the correct Android SDK installed. Try File > Invalidate Caches / Restart.
Device Not Detected
Device Not Detected
Solution:
- Ensure USB debugging is enabled on your device
- Try a different USB cable or port
- Install appropriate USB drivers for your device
- Run
adb kill-serverfollowed byadb start-server
App Crashes on Launch
App Crashes on Launch
Solution:
- Check the Logcat output in Android Studio for error messages
- Ensure your device meets the minimum SDK requirement (API 23)
- Try uninstalling and reinstalling the app
Build Failed: SDK Not Found
Build Failed: SDK Not Found
Solution:
- Open File > Project Structure > SDK Location
- Ensure the Android SDK path is correctly set
- Install the required SDK platform (API 28) via SDK Manager
Out of Memory Error During Build
Out of Memory Error During Build
Solution: Increase Gradle heap size by editing
gradle.properties: