odysee-android
odysee-android copied to clipboard
Let user update the app
PR Checklist
Please check all that apply to this PR using "x":
- [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
- [x] I have checked that this PR does not introduce a breaking change
PR Type
What kind of change does this PR introduce?
- [x] Feature
Fixes
Issue Number: #328
What is the current behavior?
For packages installed not from Play Store or FDroid, user needs to manually download the app and install it
What is the new behavior?
The app will show a snackbar when a new version is released, allowing user to install it
Notes
This PR requires that certain file exists on the update server. That file must be have a JSON format. The specification is documented on this PR code.
JSON file name and hosting can be changed. In order for this to be tested, I used my own web server, where I put a JSON file and an APK built from master branch but with a version code of 17.
To avoid accidental updates of the app while developing, the code will not run for DEBUG builds. In order to test this PR, you will need to comment out the corresponding code which checks for DEBUG builds.
New version code checking will run once every 24 hours, but user could still force the checking by quiting the app and restarting it.
How is this expected to work?
After a new version is released -I mean, after version code
has been increased-, JSON file must be updated with new version code
and the new APK file published on the URL. The URL is not expected to change between releases.
I see, that makes sense.