Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit c29d742

Browse files
committed
Updated readme
1 parent 95a6ccc commit c29d742

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

readme.MD

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
# Android Version Status Resolver and Fetcher
22

33
## Purpose of library
4-
Many applications have need to tell users to update current application because they have outdated version. Google Play doesnt support any API for that so we need to use custom solution - even some api request or service like Firebase Remote Configuration.
4+
Many applications have need to tell users to update current application because they have outdated version. Google Play doesnt support any API for that so we need to use custom solution. This library will compare current application version number to the versions that are stored in remote locations (Api request/Firebase Remote Config, ...) and show dialog to user with prompt to update his app.
55

66
## Usage
77
The simplest way for use this library is
88
```java
99
val versionFetcher = ...
10-
val versionHandler = new VersionHandler(versionFetcher)
11-
versionHandler.checkVersionStatusAndShowDefault(BuildConfig.VERSION_CODE, getSupportFragmentManager())
10+
val versionResolver = new VersionStatusResolver(versionFetcher)
11+
versionResolver.checkVersionStatusAndShowDefault(BuildConfig.VERSION_CODE, getSupportFragmentManager())
1212
```
1313

14-
this will check versions and show update dialog with the right settings.
14+
this will check versions and show update dialog with default texts. If you want to modify strings in dialog and maybe package name, you can via DialogSettings.Builder() class.
1515

16-
If you want to show custom UI with update info, you can use different method:
16+
```java
17+
val versionFetcher = ...
18+
val versionResolver = new VersionStatusResolver(versionFetcher)
19+
versionResolver.checkVersionStatusAndShowDefault(BuildConfig.VERSION_CODE, getSupportFragmentManager(),
20+
DialogSettings.Builder()
21+
.title("My custom title")
22+
.messageRes(R.string.update_dialog_message)
23+
.positiveButton("Yaay")
24+
.negativeButton("Never")
25+
.build())
26+
```
27+
28+
29+
If you want to show UI that built in dialog cant handle, you can use different method and based on result show particular UI:
1730

1831
```java
1932
val versionFetcher = ...
20-
val versionHandler = new VersionHandler(versionFetcher)
33+
val versionResolver = new VersionStatusResolver(versionFetcher)
2134

22-
versionHandler.checkVersionStatus(BuildConfig.VERSION_CODE)
35+
versionResolver.checkVersionStatus(BuildConfig.VERSION_CODE)
2336
.subscribe({ status ->
2437
if(status == UP_TO_DATE) {
2538
// app is up to date
@@ -51,7 +64,7 @@ Class `RestVersionFetcher` accepts as argument base url of server. On url GET ${
5164
compile "cz.ackee.versionfetcher:rest-fetcher:x.x.x"
5265
```
5366
## Dependencies
54-
67+
For current version check `gradle.properties` file
5568
```groovy
5669
compile "cz.ackee.versionfetcher:status-resolver:x.x.x"
5770
```

0 commit comments

Comments
 (0)