My android app takes about 3-5 seconds before it actually rotates. The whole activity is just too big to post here. Can anyone provide me some general suggestions that can make this better? Thanks all.
Related
I'm moving my first steps with ConstraintLayout in Android environment. I'm appreciating all its advantages but I've also some problems when, working at the the views in display mode, I've to wait an enormous amount of time till the arrows and all animations (that are thought to fulfill the hooking of each component) are completely loaded. Is there some way to use ConstraintLayout, with all its very useful functionalities, but avoiding arrows and similar animations which incredibly slow down the activity rendering and often lead the system to crash? I really hope you can help me. Thank you very much in advance!
Which animations are you talking about? I'm guessing the animations that we played when AutoConnect is ON? If so, you don't need to wait for them to finish -- you can continue to do things while they play -- once they complete they will do the connection. The animations only indicate that if you move the widgets, the connections will be removed.
So I have a Sencha Touch/PhoneGap + Crosswalk app whose Android startup duration I have struggled with for a while. Baseline, on first launch is around 10 seconds on a Samsung S3. After poking around and experimenting, I've learned some stuff about app launch time but don't know what I can do with it at the moment, or if there are other techniques to improve launch time.
So far, I've found:
That completely removing all images on the app (which totals ~20mb) reduces launch time to ~5 seconds.
That gutting the Sencha framework code (generated by "sencha app build package") on top of removing images reduces launch time to 2 seconds.
Gutting only my Sencha code, however, is negligible on launch time.
Clearly, messing with app size and core Sencha impacts launch time. I've done as much as I know to reduce app size (remove unnecessary images, compress images), and it's helped some, but not much. So I guess my main questions are:
Are there other notable ways to reduce PhoneGap app package size? Are there components that get added that aren't always necessary? The only other way I've seen is code obfuscation, but going from 40mb to ~37mb would have not much impact on launch time.
Is there anything I can do about how long Sencha seems to take to get fully loaded?
Am I missing anything else I can do to significantly improve app launch time? I've done a fair amount of research but haven't been able to find anything beyond basic package size; maybe I'm just using the wrong search terms.
Thanks! Any advice here would be much appreciated.
More specifically, is there a way to check the frame rate of an animation?
I am asking this because I would like to let the user know if his device is too slow for an app for which the smoothness of animation is critical.
I've always used the classical approach of yanking the time at the beginning of the render process and the end and then find the differences. Is that not enough for you case?
Frame rate is going to be highly dependent on what your are rendering and your code will presumably be calling the render methods so a timer seems the most direct and correct approach.
I have a problem i have been hunting down for the last day and i cant seem to find what is wrong. I have been working on this app for about a month without too many problems. I started working on the main interface page and one button into it this problem rears its ugly head. The problem is the screen shows up and then disappears about 30 seconds later. After watching the error it has a particular method of things happening. First my bitmaps go, then the texts after about a second, then the screen is black for about 5 seconds, then i get my phone background then about 10 seconds later the my apps show up. I never get a force close message. Id rather understand what is causing the problem then having someone tell me to change something so i can prevent it from happening again. So i don't want to post my code just yet.
other tidbits:
all my graphics are using the canvas method
since i got a 30 second window i continued working on the framework of my project the problem still has the same timing after finishing a good portion of it
the graphics i used from the working portion of my code are the same in my nonworking
the screen has no functionality to it right now its just graphics
I get the feeling i cant avoid posting my code but please try to answer it without asking for it.
Thanks to Steve for letting me know about the logcat. After updating Eclipse it became much easier to read. The problem was, not enough garbage collecting. Ironically the code that seem to be giving me problems was not the problem it was just the straw that broke the camels hump.
I have chopped up my code enough to where it is workable but i still have a lot ahead of me to fix the issue 100%.
I opened my application after I am not doing any kind of operation. I leave the mobile 5 min. After 5 min when I touch the my application it is showing black screen. Is there any way to avoid this idle state?
This is easy to do. Use: getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); in your onCreate method.
There is another way, called a WakeLock, but you really shouldn't use that unless you know what you're doing. See this post from one of the Android designers for more information about WakeLocks and why you shouldn't use them unless you're careful.