Skip to content

Basic android app configurations for start develop.

Notifications You must be signed in to change notification settings

santimattius/android-basic-skeleton

Repository files navigation

codecov Quality Checks

Android Basic Skeleton

This is basic android project with essential configurations for app develop in android.

Verification

Run check project:

> ./gradlew check

Run tests project:

> ./gradlew test

DeteKt

> ./gradlew :app:detekt

Coverage

Debug:

> ./gradlew :app:testDebugUnitTestCoverage

Release:

> ./gradlew :app:testReleaseUnitTestCoverage

Firebase

Create your Firebase project, check here: https://firebase.google.com/docs/android/setup.

Project variation with Firebase Crashlytics, here

Configure Local Secrets

Check this documentation

Using local properties for define api key:

apiKey="{your-api-key}"

Using var:

val apiKey = BuildConfig.apiKey

Using into AndroidManifest:

<meta-data android:value="${apiKey}" />

Last AGP versions

Add into gradle.properties:

android.defaults.buildfeatures.buildconfig=true

or into build.gradle.kts

android {
    buildFeatures {
        buildConfig = true
    }
}

Important: Avoid adding android.defaults.buildfeatures.buildconfig=true to your gradle.properties file because that property is deprecated in AGP 8.0 and is scheduled to be removed in AGP 9.0.

Github actions

name: Create Secrets
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:
jobs:
  keys:
    name: Tests
    runs-on: macos-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Set Up JDK
        uses: actions/setup-java@v1
        with:
          java-version: 17
      - name: Setup API Key
        env:
          APIKEY: ${{ secrets.APIKEY }}
        run: echo apiKey="$APIKEY" > ./local.properties
      - name: Set gradlew permissions
        run: chmod +x gradlew
      - name: Run Tests
        run: ./gradlew :app:check

Dependencies

Below you will find the libraries used to build the template and according to my criteria the most used in android development so far.

About

Basic android app configurations for start develop.

Resources

Stars

Watchers

Forks

Languages