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

Commit 83093a4

Browse files
author
Pavel Skala
committed
Fixes in Readme
1 parent 8ce3f82 commit 83093a4

1 file changed

Lines changed: 30 additions & 16 deletions

File tree

readme.MD

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
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. 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.
4+
Many applications have need to tell their 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 the dialog to the user with prompt to update their app.
55

66

77
This library is based on RxJava2
88
## Usage
99
The simplest way for use this library is
10-
```java
10+
```kotlin
1111
val versionFetcher = ...
1212
val versionResolver = new VersionStatusResolver(versionFetcher)
1313
versionResolver.checkVersionStatusAndShowDefault(BuildConfig.VERSION_CODE, getSupportFragmentManager())
1414
```
1515

1616
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.
1717

18-
```java
18+
```kotlin
1919
val versionFetcher = ...
2020
val versionResolver = new VersionStatusResolver(versionFetcher)
2121
versionResolver.checkVersionStatusAndShowDefault(BuildConfig.VERSION_CODE, getSupportFragmentManager(),
@@ -28,21 +28,19 @@ this will check versions and show update dialog with default texts. If you want
2828
```
2929

3030

31-
If you want to show UI that built in dialog cant handle, you can use different method and based on result show particular UI:
31+
If you want to show UI that built-in dialog cannot handle, you can use different method and based on result show corresponding UI:
3232

33-
```java
33+
```kotlin
3434
val versionFetcher = ...
3535
val versionResolver = new VersionStatusResolver(versionFetcher)
3636

3737
versionResolver.checkVersionStatus(BuildConfig.VERSION_CODE)
3838
.subscribe({ status ->
39-
if(status == UP_TO_DATE) {
40-
// app is up to date
41-
} else if(status == UPDATE_AVAILABLE) {
42-
// update is available but is not mandatory
43-
} else {
44-
// update is mandatory, user should not be able to run app
45-
}, {err ->
39+
when(status) {
40+
UP_TO_DATE -> // app is up to date
41+
UPDATE_AVAILABLE -> // update is available but is not mandatory
42+
else ->// update is mandatory, user should not be able to run app
43+
}}, {err ->
4644
// some error happened while fetching version info
4745
})
4846

@@ -56,22 +54,38 @@ Two basic implementation are provided in separate modules - Firebase Remote Conf
5654
### Firebase Remote Config
5755
Class `FirebaseVersionFetcher` takes optional argument for cache expiration of fetched data from Firebase Remote Config. Default names of attributes are `minimal_version_android` and `current_version_android` but you can modify that with constructor attributes.
5856
```groovy
59-
compile "cz.ackee.updatechecker:firebase-fetcher2:x.x.x"
57+
implementation "cz.ackee.updatechecker:firebase-fetcher:x.x.x"
6058
```
6159

6260

6361
### Rest Api
6462
Class `RestVersionFetcher` accepts as argument base url of server. On url GET ${baseUrl}/app-version is expected response with attributes `minimal_version_android` and `current_version_android` (names can be also modified)
6563
```groovy
66-
compile "cz.ackee.updatechecker:rest-fetcher2:x.x.x"
64+
compile "cz.ackee.updatechecker:rest-fetcher:x.x.x"
6765
```
6866
## Dependencies
6967
For current version check `gradle.properties` file
7068
```groovy
71-
compile "cz.ackee.updatechecker:status-resolver2:x.x.x"
69+
compile "cz.ackee.updatechecker:status-resolver:x.x.x"
7270
```
7371

7472

7573
### Sample
7674

77-
In the `app` module is sample that demonstrates basic usage of library with mocked fetcher.
75+
In the `app` module is sample that demonstrates basic usage of library with mocked fetcher.
76+
77+
78+
## License
79+
Copyright 2018 Ackee s.r.o.
80+
81+
Licensed under the Apache License, Version 2.0 (the "License");
82+
you may not use this file except in compliance with the License.
83+
You may obtain a copy of the License at
84+
85+
http://www.apache.org/licenses/LICENSE-2.0
86+
87+
Unless required by applicable law or agreed to in writing, software
88+
distributed under the License is distributed on an "AS IS" BASIS,
89+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90+
See the License for the specific language governing permissions and
91+
limitations under the License.

0 commit comments

Comments
 (0)