-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve overall app performance #62
Comments
I'll definitely try and make a PR to the app if you guys are accepting contributions. |
We do accept PRs, preferably to Dev as that's the working branch, master is for release ready code |
Feel free to contribute, but please try to open PR on dev branch instead of master |
Sure 👍 |
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. |
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 |
@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. |
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 |
@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? |
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. |
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 |
This is an example (this time there were no forced closings). 1 minute of stuck: |
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 😁 |
That's not something I can fix, here's a explanation: |
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). |
@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 |
We can fetch them after entering the HomeFragment. Internet speed shouldn't really be a reason for crash. |
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 |
@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. |
@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 |
@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 |
Please only report your issue here, if all points below are true
Phone Specifications:
Please describe the problem you are having in as much detail as possible:
Hey guys, I just installed the app to try and test it but the app startup time was huge on my phone. I'm probably thinking this is due to a lot of fragments that are being loaded during app startup. I've forked the app and found some changes that can improve the app performance a bit.
Steps to reproduce:
Generally navigate around the app. Also Logcat was spamming with skipped frames message.
Further details:
The text was updated successfully, but these errors were encountered: