Skip to main content
This guide will help you set up your development environment to start contributing to Simple Alarm Clock.

Prerequisites

Before you begin, ensure you have the following tools installed:
1

Install Android Studio

Download and install Android Studio (latest stable version recommended).
2

Install Java Development Kit (JDK)

Install JDK 8 or higher. Android Studio typically includes a JDK, but you can also install it separately:
  • OpenJDK 8+
  • Oracle JDK 8+
3

Install Android SDK components

Using Android Studio’s SDK Manager, install:
  • Android SDK Platform 33 (compileSdk)
  • Android SDK Build-Tools 26.0.2 or higher
  • Android SDK Platform-Tools
  • Android SDK Tools
4

Install Kotlin plugin

Android Studio comes with Kotlin support built-in. The project uses Kotlin 1.9.22.
The project requires:
  • Minimum SDK: API 21 (Android 5.0)
  • Target SDK: API 33 (Android 13)
  • Compile SDK: API 33

Clone the repository

Clone the Simple Alarm Clock repository to your local machine:
git clone https://github.com/yuriykulikov/AlarmClock.git
cd AlarmClock

Open the project in Android Studio

1

Import the project

  1. Open Android Studio
  2. Select File > Open
  3. Navigate to the cloned repository directory
  4. Select the root directory and click OK
2

Sync Gradle

Android Studio will automatically start syncing the project with Gradle. If it doesn’t, click File > Sync Project with Gradle Files.The project uses:
  • Gradle 7.4.2
  • Android Gradle Plugin 7.3.1
3

Wait for indexing

Allow Android Studio to finish indexing the project. This may take a few minutes on the first run.

Configure local properties

Create a local.properties file in the root directory if it doesn’t exist:
local.properties
sdk.dir=/path/to/your/Android/sdk
Android Studio usually creates this file automatically with the correct SDK path.

Optional: ACRA email configuration

If you want to configure crash reporting for development builds, add the following to your local.properties:
local.properties
acra.email=your-email@example.com
Alternatively, you can set the ACRA_EMAIL environment variable.

Verify the setup

To verify your setup is working correctly:
  1. Open the project in Android Studio
  2. Wait for Gradle sync to complete
  3. Check that there are no errors in the Build tab
  4. Try building the project (see Building for details)
If you encounter Gradle sync issues, try:
  • File > Invalidate Caches / Restart
  • Deleting .gradle and .idea directories
  • Running ./gradlew clean from the terminal

Code formatting

The project uses Spotless for code formatting:
  • Kotlin: ktfmt formatter
  • Java: Google Java Format
To format your code before committing:
./gradlew spotlessApply
To check if your code is properly formatted:
./gradlew spotlessCheck
Set up a pre-commit hook to automatically format your code. See the .githooks directory for examples.

Next steps

Now that your development environment is set up:

Build docs developers (and LLMs) love