Explore why Android's screen scrolling is not as smooth as the IPhone's _android

Source: Internet
Author: User

In fact, I think the main or developers for the application of the optimization is not enough, too many overdraw and layout aspects of the problem, the Android developers themselves in order to fit the screen resolution and solve some other compatibility problems has been a lot of effort, Few developers spend a lot of time doing detailed performance optimizations, and some don't even know the direction of optimization. Now the official microblogging client to me to see in the overdraw is still very serious, and then in the asynchronous loading of the picture when the frame rate is not stable enough, not fluent. Moreover, because the Android platform itself is not powerful enough to optimize the rotten application can run very smooth exposed the fact that the optimization is not enough, especially the handset manufacturer's custom ROM compared to the original system has some degree of sacrifice some fluency caused the problem to become more obvious, So it takes more effort than iOS to make a slick application on Android.

In fact, Google has been at the system level over the years to improve the system's UI performance, from hardware acceleration to project butter to reorder&merge drawing operations, and so on, but I feel that Google for the Android development of the best combat campaign not enough, How many developers in the country have seen the Android session above the I/O conference on YouTube? The session is spoken almost every year about the performance of the system's graphics. So there are also problems with the level and scope of domestic developer development.

To sum up: one is limited by the Android platform itself is not strong enough to make the same fluency of applications than iOS more difficult, and second, the domestic developers for the Android Development performance optimization of best practices know little.

Update

Some answers say that the response speed of a screen touch is not a reliable answer to the problem of the greatest degree of fluency. I've developed the Android app myself, and one example can challenge the conclusion: Why are native systems (such as Android4.4 NEXUS5) running on their own with apps that run silky smooth while 3rd-party apps (especially domestic applications) generally compare cards? Are they running the same environment? Is the same with the screen? Why is fluency just a little bit worse? The reason is that Systemapp was developed by Google, and their developers learned how to make good applications and understand best practices for andorid development. and the 3rd party developer level is uneven, the optimization experience is inferior to the Google Developer, causes writes the application to run the efficiency also inferior systemapp, stands in the same system and the operating environment inside speaks, this is the main reason.

Some of the above tests, which reflect a delay in the transient response of the finger to the screen, do not fully explain why Android is not as fluent as iOS. I think there are 2 main aspects of fluency: one is touch response delay, one is the frame rate of rendering, and the latter is of greater importance. Can you imagine whether the 100ms delay from touching the screen to the UI began to slip to you, or did it feel large in the process of sliding with the unstable frame rate? In fact, Google's Android version of the update has been working to improve the screen touch latency (a 4.4 update to find an interesting to see: Android-4.4 KitKat), although it may still not compare with iOS, but I think the gap in this area has been very small, The difference in feelings is also very subtle and imperceptible.

More fluid flow is still reflected in the optimization of poor application run unstable frame rate above, such as a transient background thread after the asynchronous loading of the picture completed in the UI process to execute a callback method to display, If the picture is too large to be based on scaletype real-time zoom to the appropriate size display to the imageview above, this time if the picture too large zoom operation time is too long may cause the main thread blocking a long time, affecting the system UI process in the unit time slice of the rendering, resulting in the frame. Let me cite an example to refute the view that screen touch response speed is the most important problem of fluency: why is it that a list item that slides a single line of text does not generally feel like a card, whereas a list item (such as a microblog) that displays a more complex layout compares the card? Do they have the same screen and running environment? Is there a touch delay? Why, then? This is because the layout of the list items is too complex, and the UI controls spend more time in the entire drawing process (Onmeasure ()->onlayout () allocation position->ondraw () Drawing) For example, the relative position and size of each UI control may be interacting with each other, which results in more time to compute the size and position when rendering each frame, and then the drawing phase will also require some more drawing operations to finish drawing all UI controls. Faced with a complex interface, experienced developers try to avoid overdraw (transition rendering) of the interface, reduce the UI hierarchy, and choose better viewgroup (such as framelayout performance than LinearLayout, LinearLayout performance is better than relativelayout performance, but the most powerful adaptability of the layout is the best relativelayout, in the functional implementation and performance optimization in the balance to achieve the optimal needs of experience), to avoid real-time zoom graphics, Avoid the reduction of GC frequency in the critical path creation of frequent calls, reasonable management bitmap large objects (LruCache), etc. (of course there are some other optimization techniques not listed here). And the answer to the process priority question is not the main reason, Android's UI rendering process may not be the highest priority, but it is also relatively high, and does not say that the UI rendering priority is set to a lower level than the background thread, without excessive discussion, Google is not stupid enough to Defy yourself to see the Android SDK source code.

I don't deny that screen touch latency is also one of the reasons why Android slides don't feel smooth, but from the perspective of a developer, I think the impact of the current Android version of the system is far less than the impact of application optimization, Optimized Android apps run on the latest Android version and are basically as fluent as iOS apps.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.