Git Product home page Git Product logo

Comments (23)

Skrilltrax avatar Skrilltrax commented on May 16, 2024 2

Hey, do you mind if we keep this open? The data binding PR does not solve the issue. I will be contributing more to help reduce the overall startup time.

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024 1

Feel free to contribute, but please try to open PR on dev branch instead of master

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024 1

@X1nto Have you add a check to avoid multiple downloads of the same package (vanced or microg), after pressing the download button again?

No, it's easier to redownload because sometimes downloaded package may be corrupted and to avoid this we redownload again. I don't see any issues here because 1. Wifi is unlimited 2. Who will download using mobile data?

from vancedmanager.

 avatar commented on May 16, 2024 1

@X1nto

This is an example (this time there were no forced closings). 1 minute of stuck:

https://streamable.com/owgw9e

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024 1

We can fetch them after entering the HomeFragment. Internet speed shouldn't really be a reason for crash.

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024 1

@X1nto I checked the commit and it looks great. However, your model class still fetches each item by itself which technically isn't the responsibility of a Model. Fetching should be done by a Repository. This can be changed by making a Data Class. I can link you to some examples if you want or I'll just make a PR as soon as I get time from college and work.

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024

I'll definitely try and make a PR to the app if you guys are accepting contributions.

from vancedmanager.

KevinX8 avatar KevinX8 commented on May 16, 2024

We do accept PRs, preferably to Dev as that's the working branch, master is for release ready code

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024

Sure 👍

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

Well, sure. I don't really think that app loads all fragments on start, but I can't deny it either because I don't know how navigation libs work. Feel free to make a PR whenever you find a way to improve app

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024

@X1nto Yeah fragments may not be an issue at all but the app is still doing a lot of processing at startup. I'll try and look at other parts that may be causing an issue. Also, stuff like switching between root and non-root mode increases the load on the main thread, I think some of that work can be pushed over to the background thread for a better UX.

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

Hmm, might be issue with loading data from the server, but as far as I know getjson library uses AsyncTask to load data, so it should be fine. Switching from root and nonroot just recreates activity with overridePendingTransition, so the issue should be with home fragment I guess, or it's viewmodel

from vancedmanager.

 avatar commented on May 16, 2024

@X1nto Have you add a check to avoid multiple downloads of the same package (vanced or microg), after pressing the download button again?

from vancedmanager.

 avatar commented on May 16, 2024

@X1nto

However I think that I have understand why the app stuck on the splashscreen at startup, and concerns the optimizations mentioned by skrilltrax: with slow network there are difficulties in contacting the server, and after a while the app forcely closed.

If will be happen again I will try to make a video.

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

@X1nto

However I think I understand why the app stuck on the splashscreen at startup, and concerns the optimizations mentioned by skrilltrax: with slow network there are difficulties in contacting the server, and after a while the app forcely closed.

If will be happen again I will try to make a video.

I don't see a reason why slow internet would slow down app loading speed. You don't need a good internet to load data from server, you need at least 10kbps and I'm pretty sure you have much better connection than this

from vancedmanager.

 avatar commented on May 16, 2024

@X1nto

To simplify your tests set your cellular data to edge (2g), open app and wait three seconds before totally disable cellular data. With this approach you can also trigger a FC 😁

https://streamable.com/4o7sln

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

@X1nto

To simplify your tests set your cellular data to edge (2g), open app and wait three seconds before totally disable cellular data. With this approach you can also trigger a FC 😁

https://streamable.com/4o7sln

That's not something I can fix, here's a explanation:
When you start app, it's on splash screen until app loads all the required data for it to show layout, when you have a slow connection, it takes a very long time to load data, Android sees that application shows a blank splash screen for more than 10 seconds and just kills app.
Solution: upgrade your network speed

from vancedmanager.

 avatar commented on May 16, 2024

@X1nto
To simplify your tests set your cellular data to edge (2g), open app and wait three seconds before totally disable cellular data. With this approach you can also trigger a FC grin
https://streamable.com/4o7sln

That's not something I can fix, here's a explanation:
When you start app, it's on splash screen until app loads all the required data for it to show layout, when you have a slow connection, it takes a very long time to load data, Android sees that application shows a blank splash screen for more than 10 seconds and just kills app.
Solution: upgrade your network speed

Maybe you can implement a minimum timelapse (3 seconds?), before showing a window of download failed due to slow connection, and maybe add another one when the connection is totally lost (to avoid crash).

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024

@X1nto I think that can be fixed. The only data that needs to fetched from the server are changelogs. That can be lazily fetched whenever the user requests it. This will help in implementing a No Internet state in the app and will reduce the number of crashes that people experience.

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

@X1nto I think that can be fixed. The only data that needs to fetched from the server are changelogs. That can be lazily fetched whenever the user requests it. This will help in implementing a No Internet state in the app and will reduce the number of crashes that people experience.

Hmm, app loads latest versions too, not only changelogs. These are loaded in HomeViewModel

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

Just pushed new commits which fetch Json data asynchronously, without blocking the UI thread. This should fix the issue with splash screen getting stuck for some users with slow internet. e9c3e7a

from vancedmanager.

Skrilltrax avatar Skrilltrax commented on May 16, 2024

@X1nto That's great. I was working on something similar but couldn't complete it. Another improvement that I would like to suggest would be using a Model class with retrofit to fetch all the data as a single object rather than fetching each item separately.

from vancedmanager.

X1nto avatar X1nto commented on May 16, 2024

@Skrilltrax Added model class in b1e0db8 and honestly, I should've done it earlier. Fetching stuff is much easier now and doesn't require declaring thousand different variables

from vancedmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.