This repository provides commonly shared functions being used across Android apps
The TTS function is provided via TextToSpeechViewModel, which is implemented using Hilt and kapt So, make sure you have Hilt & kapt imported in your projects via below check-list:
- Add Hilt and kapt plugins in
app/build.gradle
fileapply plugin: 'dagger.hilt.android.plugin' apply plugin: 'org.jetbrains.kotlin.android' apply plugin: 'kotlin-kapt'
- Add Hilt &
common-utils
dependencies inapp/build.gradle
fileimplementation 'com.github.elimu-ai:common-utils:1.0.1' implementation 'com.google.dagger:hilt-android:2.55' kapt 'com.google.dagger:hilt-compiler:2.55'
- Add Hilt & Kotlin gradle plugin classpaths to project's
build.gradle
fileclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0" classpath "com.google.dagger:hilt-android-gradle-plugin:2.55"
- Add
@HiltAndroidApp
to your Application class - Add
@AndroidEntryPoint
to your Activity/Fragment - Initialize your
TextToSpeechViewModel
in youronCreate
method of your Activity/Fragmentprivate lateinit var ttsViewModel: TextToSpeechViewModel fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ttsViewModel = ViewModelProvider(this)[TextToSpeechViewModelImpl::class.java] }
- Now you're ready to use the Text to Speech function
- Change the
libVersion
andversionCode
in https://github.com/elimu-ai/common-utils/blob/main/utils/build.gradle - Under
publishing
->repositories
block in the same Gradle script: Replace the existingmaven
repo bymavenLocal()
- Run
./gradlew clean utils:publishReleasePublicationToMavenLocal
from project's root folder - In app side: Add
mavenLocal()
torepositories
block inbuild.gradle
script - Implement
ai.elimu.common:utils:$snapshot_version
in app'sbuild.gradle
file - You're now ready to test the snapshot!
- Update versionCode, versionName in
utils/build.gradle
file by increment either major/minor/patch number and merge tomain
(Do not remove theSNAPSHOT
suffix) - Trigger
Release
task in Github Actions onmain
branch - Draft a new Release in https://github.com/elimu-ai/common-utils/releases
Important
After you publish a new release, remember to also bump the version in all Android app repos that depend on the utils
library:
elimu.ai - Free open-source learning software for out-of-school children πβ¨
Website π β’ Wiki π β’ Projects π©π½βπ» β’ Milestones π― β’ Community ππ½ β’ Support π