Skip to main content

Building the Application

Using Android Studio

1

Open the Project

Ensure the MorseIt project is open in Android Studio.
2

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)
3

Build the Project

Click Build > Make Project or press Ctrl+F9 (Windows/Linux) / Cmd+F9 (macOS).
4

Verify Build Success

Check the Build output window for success messages. The APK will be generated in app/build/outputs/apk/.

Using Gradle Command Line

You can also build the project using Gradle from the command line:
./gradlew assembleDebug
The generated APK files will be located at:
  • 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)

1

Open AVD Manager

Click Tools > AVD Manager in Android Studio.
2

Create Virtual Device

Click Create Virtual Device and select a device definition (e.g., Pixel 4).
3

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
4

Finish Setup

Configure AVD settings (RAM, storage, etc.) and click Finish.

Launch the App on Emulator

1

Start the Emulator

In the AVD Manager, click the play button next to your virtual device to launch it.
2

Select Device in Android Studio

Once the emulator is running, select it from the device dropdown in the toolbar.
3

Run the App

Click the Run button (green play icon) or press Shift+F10 (Windows/Linux) / Ctrl+R (macOS).
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

1

Enable Developer Mode

On your Android device, go to Settings > About Phone and tap Build Number 7 times.
2

Enable USB Debugging

Go to Settings > Developer Options and enable USB Debugging.
3

Connect Device

Connect your Android device to your computer using a USB cable.
4

Authorize Computer

When prompted on your device, authorize your computer for USB debugging.

Deploy to Device

1

Verify Device Connection

Your device should appear in the device dropdown in Android Studio’s toolbar.
2

Run the App

Select your device from the dropdown and click the Run button.
3

Grant Permissions

If prompted on your device, grant any necessary permissions for the app to run.

Verify Device Connection (Command Line)

You can verify that your device is connected using ADB:
adb devices
This should list your connected device. If not, ensure USB debugging is enabled and drivers are installed.

Running Tests

MorseIt includes unit tests and instrumented tests.

Unit Tests

Run unit tests from the command line:
./gradlew test
Or in Android Studio: right-click on app/src/test/java and select Run Tests.

Instrumented Tests

Run instrumented tests (requires a connected device or emulator):
./gradlew connectedAndroidTest
Or in Android Studio: right-click on app/src/androidTest/java and select Run Tests.

Common Issues and Solutions

Solution: Check your internet connection and ensure you have the correct Android SDK installed. Try File > Invalidate Caches / Restart.
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-server followed by adb start-server
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
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
Solution: Increase Gradle heap size by editing gradle.properties:
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m

Next Steps

Now that you can build and run the app, learn about the codebase structure in Project Structure.

Build docs developers (and LLMs) love