Skip to content

This repository provides commonly shared functions being used across Android apps

License

Notifications You must be signed in to change notification settings

elimu-ai/common-utils

Repository files navigation

common-utils

This repository provides commonly shared functions being used across Android apps

How to use TTS function?

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:

  1. Add Hilt and kapt plugins in app/build.gradle file
    apply plugin: 'dagger.hilt.android.plugin'
    apply plugin: 'org.jetbrains.kotlin.android'
    apply plugin: 'kotlin-kapt'
  2. Add Hilt & common-utils dependencies in app/build.gradle file
    implementation 'ai.elimu:common-utils:1.0.1'
    implementation 'com.google.dagger:hilt-android:2.55'
    kapt 'com.google.dagger:hilt-compiler:2.55'
  3. Add Hilt & Kotlin gradle plugin classpaths to project's build.gradle file
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0"
    classpath "com.google.dagger:hilt-android-gradle-plugin:2.55"
  4. Add @HiltAndroidApp to your Application class
  5. Add @AndroidEntryPoint to your Activity/Fragment
  6. Initialize your TextToSpeechViewModel in your onCreate method of your Activity/Fragment
    private lateinit var ttsViewModel: TextToSpeechViewModel
    fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ttsViewModel = ViewModelProvider(this)[TextToSpeechViewModelImpl::class.java]
    }
  7. Now you're ready to use the Text to Speech function

How to publish a snapshot for local development & testing?

  1. Under publishing -> repositories block in the same Gradle script: Replace the existing maven repo by mavenLocal()
  2. Run ./gradlew clean utils:publishReleasePublicationToMavenLocal from project's root folder
  3. In app side: Add mavenLocal() to the repositories block in build.gradle script
  4. You're now ready to test the -SNAPSHOT version!

How to release a new version?

  1. Update versionCode, versionName in utils/build.gradle file by increment either major/minor/patch number and merge to main (Do not remove the SNAPSHOT suffix)
  2. Trigger Release task in Github Actions on main branch
  3. 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 💜

About

This repository provides commonly shared functions being used across Android apps

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages