The App Version Tracker Android Library is a Kotlin-based solution that enables Android developers to track the latest version of their app with ease. This library is designed for apps distributed outside the Play Store, allowing you to check for updates based on data managed through the App Version Tracker website.
You might wonder: can developers simply use Retrofit and implement this? While the answer is yes, setting up Retrofit and creating DTOs can be tedious for a simple app. This library simplifies the process, making version tracking quick and easy.
-
Login and Setup: Register on the App Version Tracker website, log in, and add your app details to your account, including version info and download link.
-
Include the Library: Add this library to your Android project.
-
Get Version Info: Call the
getLatestAppVersionfunction with your API key and app name to retrieve the latest version data you’ve entered on the website.
App Version Tracker is published to jitpack, so to add jitpack to your project repository
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
// ...
}Then add the dependency
implementation ("com.github.sai-charan2003:Version-Tracker-Android-Library:<latest-version>")Ensure that you have added the Internet permission in your AndroidManifest.xml 😉
To retrieve the latest app version information, use the following code snippet:
VersionTracker.getLatestAppVersion(<App_Name>, <API_KEY>).observeForever { processState ->
when (processState) {
is ProcessState.Error -> {
// Handle error response
// e.g., Log.e("AppVersionTracker", "Error: ${processState.message}")
}
ProcessState.Loading -> {
// Handle loading state
// e.g., show a loading indicator if needed
}
is ProcessState.Success -> {
val response = processState.autoUpdateDTO
// Use the response data
// e.g., Log.d("AppVersionTracker", "App version: ${response.appVersion}")
}
}
}The response is of type AutoUpdateDTO, which contains the following fields:
data class AutoUpdateDTO(
appName: String? = null,
appVersion: Double? = null,
appVersionCode: Double? = null,
appDownloadLink: String? = null,
appUUID: String? = null
)You can find the backend source code for the App Version Tracker here.
The App Version Tracker website is built using Flutter. You can access the frontend source code here.