This is basic android project with essential configurations for app develop in android.
Run check project:
> ./gradlew check
Run tests project:
> ./gradlew test
> ./gradlew :app:detekt
Debug:
> ./gradlew :app:testDebugUnitTestCoverage
Release:
> ./gradlew :app:testReleaseUnitTestCoverage
Create your Firebase project, check here: https://firebase.google.com/docs/android/setup.
Project variation with Firebase Crashlytics, here
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}" />
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.
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
Below you will find the libraries used to build the template and according to my criteria the most used in android development so far.
- Hilt, dependencies provider.
- Retrofit, networking.
- Gson, json parser.
- Coil, with image loader.
- Kotlin coroutines.
- Mockk, testing library.
- MockWebServer, networking testing library.