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.gradlefileapply plugin: 'dagger.hilt.android.plugin' apply plugin: 'org.jetbrains.kotlin.android' apply plugin: 'kotlin-kapt'
- Add Hilt &
common-utilsdependencies inapp/build.gradlefileimplementation 'ai.elimu: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.gradlefileclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0" classpath "com.google.dagger:hilt-android-gradle-plugin:2.55"
- Add
@HiltAndroidAppto your Application class - Add
@AndroidEntryPointto your Activity/Fragment - Initialize your
TextToSpeechViewModelin youronCreatemethod 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
- Under
publishing->repositoriesblock in the same Gradle script: Replace the existingmavenrepo bymavenLocal() - Run
./gradlew clean utils:publishReleasePublicationToMavenLocalfrom project's root folder - In app side: Add
mavenLocal()to therepositoriesblock inbuild.gradlescript - You're now ready to test the
-SNAPSHOTversion!
- Update versionCode, versionName in
utils/build.gradlefile by increment either major/minor/patch number and merge tomain(Do not remove theSNAPSHOTsuffix) - Trigger
Releasetask in Github Actions onmainbranch - 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 💜
