stantanasi / streamflix

An Android TV and mobile app to stream movies and TV shows for free
Apache License 2.0
635 stars 77 forks source link

In App Updater #22

Closed DarkCrypt closed 1 year ago

DarkCrypt commented 1 year ago

Summary

Because this app is an Android Tv build and also because of your continuously growing user base, an in app updater would be a very helpful feature. This makes it easy to update the app with a tv remote and eliminate the need to acquire updates from outside the app.

You could implement a "Settings" option in the menu where an updater could be included and more. See screenshot.

Screenshot_Settings

Please confirm the following

stantanasi commented 1 year ago

Great idea! I don't really know how to implement an in-app updater. Should I have a button in settings that targets the app's latest APK? Or maybe I need to install a dependency?

If you have any documentation, I'll be glad to get it.

DarkCrypt commented 1 year ago

Should I have a button in settings that targets the app's latest APK? Or maybe I need to install a dependency?

I'm thinking more than likely both. You'll definitely need a download button that targets the latest APK from your Github release page(or any external link). I also think you might need some kind of dependency for this function.

I've been trying to find some kind of documentation or code for implementation. The Android developers website says in-app updates are only supported for Android mobile devices, Android tablets, and Chrome OS devices. Most implementation methods I've read about require Google Play Core libraries and this is completely unacceptable and ridiculous. I know an in-app updater is possible because CloudStream does this and it works great.

With that being said, I did find a few repos on Github that hopefully will help make this feature a reality...

LocalAppUpdate - Can be used for downloading the Apk from a link, save it to external or internal storage, and then automatic installing of the APK. This repo also has a working demo APK in the app folder which is a good representation of what we're wanting to do.

In-App-Update-Compose - A way to make in app updates in compose. I didn't see a demo APK.

CloudStream - This leads to CloudStream's in-app updater file.

If the first 2 repos won't work, CloudStream's example should for sure. At least I'd think so.

stantanasi commented 1 year ago

Thanks a lot, I'll look into the repositories you provided. I think I'll add a download button that targets the latest version/APK first, since that seems easy to do. And then I'll see if it's possible to improve it.

DarkCrypt commented 1 year ago

Ok, sounds good. I really appreciate your time, hard work, and dedication to this app. Thank you for being an awesome dev!

stantanasi commented 1 year ago

Thank you, it means a lot to me ❤️

stantanasi commented 1 year ago

Should work from Release 1.3.1, I'll have to check if it works when a new release comes out.

At launch, if a new version is available, a dialog will be displayed proposing the update of the application. image

DarkCrypt commented 1 year ago

I installed v1.3.1 and am excited to try this out when a future update is released. The screenshot looks great! For my own curiosity, did the repos I suggested above work for you or did you have to try something different?

stantanasi commented 1 year ago

Yep thanks a lot for the repos, I mostly used CloudStream to implement this functionality. As you can see some similarities in SFlix's InAppUpdater file.

DarkCrypt commented 1 year ago

Fantastic! I'm so pumped I was able to help in this way! As I look at the differences, you were able to implement this feature with a lot less code as well. I find it very interesting and inspiring that you are a self-taught dev. This is not only impressive but incredible. I think you're doing an amazing job!

stantanasi commented 1 year ago

Indeed, they have developed a lot of code for their different versions and features, while I only have to download my latest version and install it. Thank you so much for your words and encouragement! Being a self-taught developer has been a challenging but rewarding journey for me. It means a lot to hear that my efforts are appreciated. ❤️

It's never too late to start developing!!

stantanasi commented 1 year ago

It should be possible to update the application to version 1.3.2 directly when launching the application. PS: I decided to change the name of my application. When installing the new version, there will be two apps StreamFlix and SFlix, please uninstall the previous app SFlix.

DarkCrypt commented 1 year ago

I updated to v1.3.2 on app launch and all worked like it should, then uninstalled the Sflix version.

I like the name change and I think it was the right move because now you have your own branding. Sweet!

Are you planning on changing the logo as well?

stantanasi commented 1 year ago

Are you planning on changing the logo as well?

I'm planning to change it but I'm not a designer so I don't have any idea 😆. So it could take time until I change it.

DarkCrypt commented 1 year ago

I hear that, I'm not a designer either. It could still be a S but what should it look like? Hmm 🤔, if my brain does come up with something I'll let you know.