Skip to main content

Android - DevApp Setup

This guide covers cloning the repository, setting up authentication, and configuring your project in Android Studio.

Clone the Repository

Clone the Android DevApp repository using Git:

git clone git@code.q2developer.com:Q2Antilles/native/android/devapp-android.git

Alternatively, visit the repository and clone it via SSH or HTTPS.

Once cloned:

  1. Open Android Studio.
  2. Go to File > Open and select the cloned repository.

Generate a Personal Access Token

The first time you build the project, Gradle may fail due to a missing msdk_repo_token. You need to generate a Personal Access Token (PAT) to authenticate.

Steps to Generate a PAT

  1. Go to the repository.
  2. Click your user icon (top-right), then select Preferences.
  3. Under Access Tokens, click Add New Token.
  4. Enter a name (e.g., "Android DevApp") and enable api, read_api, read_registry, and read_repository scope.
  5. Click Create personal access token and copy the token (you won’t be able to see it again).

Profile Preferences

Update settings.gradle

Add the generated token to settings.gradle:

  1. Open settings.gradle in Android Studio.

  2. Locate the Maven repository configuration:

    maven {
    url "https://code.q2developer.com/api/v4/groups/782/-/packages/maven"
    credentials(HttpHeaderCredentials) {
    name = "Private-Token"
    value = msdk_repo_token
    }
    authentication {
    header(HttpHeaderAuthentication)
    }
    }

  3. Replace msdk_repo_token with your actual token:

Open settings.gradle and update the value field with your generated token:

maven {
url "https://code.q2developer.com/api/v4/groups/782/-/packages/maven"
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = "your_generated_token_here"
}
authentication {
header(HttpHeaderAuthentication)
}
}

Resync Gradle

After updating settings.gradle, resync the project to apply the changes:

  • Click Sync Now in the notification bar.
  • Or go to File > Sync Project with Gradle Files in the top menu.

If the sync completes without errors, the project is ready to run.

Run the Project

  1. In Android Studio, select a connected device or emulator.
  2. Click Run or press Shift + F10 to launch the application.

For troubleshooting, refer to the repository documentation or contact the development team.