Skip to content

suitetecsa/apklisupdate

 
 

Repository files navigation

Check app update in Apklis

Installing

  • Step 1. Add the JitPack repository to your build file
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  • Step 2. Add the dependency
implementation 'com.github.Z17-CU:apklisupdate:$VERSION'	

Usage

  • Check current app
 ApklisUpdate.hasAppUpdate(this, callback = object : UpdateCallback {

            override fun onNewUpdate(appUpdateInfo: AppUpdateInfo) {

                //Start info alert dialog or do what you want.
                ApklisUpdateDialog(
                    this@MainActivity,
                    appUpdateInfo,
                    ContextCompat.getColor(
                        this@MainActivity,
                        R.color.colorAccent)
                ).show()

                //Start info fragment or do what you want.
                supportFragmentManager.beginTransaction().add(
                    R.id.container, ApklisUpdateFragment.newInstance(
                        updateInfo = appUpdateInfo,
                        actionsColor = ContextCompat.getColor(this@MainActivity, R.color.colorAccent)
                    )
                ).commit()

            }

            override fun onOldUpdate(appUpdateInfo: AppUpdateInfo) {
                Log.d("MainActivity", "onOldUpdate $appUpdateInfo")
            }

            override fun onError(e: Throwable) {
                e.printStackTrace()
            }
        })
  • Check external app
ApklisUpdate.hasAppUpdate("APP_PACKAGE_NAME", callback = object : UpdateCallback {...})

Contributing

All contributions are welcome!!!

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 96.7%
  • Java 3.3%