Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-App Updating Option (Closes #121) #133

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

LoVega1337
Copy link

@LoVega1337 LoVega1337 commented May 8, 2022

Closes #121

Added Button to download latest version from this Repo and automatically install it. So basically updating it.

  • Shows current version top left
  • Added button to update and install latest version of the app from this repo
  • If new version is available, a text at the top in the Home screen shows up and the button will download and install the update
  • If NO new version is available, the text in the Home screen won't show up and click on the button will show that you're using the latest version

It does get the latest update from "https://github.com/leonardoxh/race-control-tv/releases/latest/download/app-release.apk".
It fetches the latest version from "https://github.com/leonardoxh/race-control-tv/blob/master/app/build.gradle.kts" (direct link here "https://raw.githubusercontent.com/leonardoxh/race-control-tv/master/app/build.gradle.kts").
So basically every time a new release comes out and build.gradle gets updated for the release, it shows a version mismatch and will show there's an update.

To do:

  • DONE ✔️Show new version number in Notification
  • DONE ✔️Notification next to button if new version is available
  • DONE ✔️Check if latest version is installed after clicking button and making toast if no new version is available
  • DONE ✔️Put button next to Settings button (is currently above)
  • DONE ✔️Use translation strings instead of hardcoded strings

@LoVega1337 LoVega1337 changed the title In-App Updating Option In-App Updating Option (Closes #121) May 8, 2022
- Added constraint to button
- Added version number showing top left in home screen
- Added translation strings in updater instead of hardcoded strings
- Added invisible text to indicate new version is available (for later use)
Finalized everything, could use simplifcation and tidying up in the future

val httpsURL =
"https://raw.githubusercontent.com/leonardoxh/race-control-tv/master/app/build.gradle.kts"
val myUrl = URL(httpsURL)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this entire thing to a separate class like updateService ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also use coroutines to handle this network part.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can do that.
I thought about planning it like this: Merging and publishing a new release with this current version of the updater so the users have a general update service, so they don't need to manually sideload the new version every time.

After this I'll open a new PR to refine the code and put them into another class and also convert the ThreadWorker to Coroutines. This then can be updated into another release when there are other significant changes to the app.

Do we wanna do it like this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to put all of this in 1 PR.

Because this async task work and manual work seems like 2010 :D Also AsyncTask is deprecated...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And second... As the app is pretty much dead (no live content yet) I'd say no rush on this one.

Copy link
Author

@LoVega1337 LoVega1337 May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so I have played around with Coroutines a bit and everything I try fails, so I need to do some research on this, since I only worked on small projects and with Async tasks so far. So this might take a while.

@JustJoostNL
Copy link

Hope that this will be implemented soon!

@leonardoxh
Copy link
Owner

I see the work with the async task still has to be done... Do you want me to take over this PR?

I will probably have some time this weekend.

@LoVega1337
Copy link
Author

LoVega1337 commented Jul 6, 2022

@leonardoxh Yeah sure.
I tried using Coroutines before seperating the tasks in different Classes but even then I couldn't get the Coroutines to work, but I rather think this is a lack of knowledge from myself on that part. That's why I really haven't made progress since. So yes, please take over. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Updating through in-app option
3 participants