Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Android Mobile phone operating system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you an example analysis of the Android mobile operating system. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

The basic features of Android mobile operating system include an internal integrated browser based on the open source WebKit engine, the optimized graphics library includes 2D and 3D graphics libraries, and the 3D graphics library is based on OpenGL ES 1.0.

For example, a picture you want to post. All child elements will be fixed in the upper-left corner of the screen; you cannot specify a location for a child element in FrameLayout. The latter child element will be overridden directly above the previous child element.

Block some or all of them (unless the latter child element is transparent). It's a little roundabout and difficult to understand, so let's understand it through an example. We emulate the interface used in the Snake project to create a simple FrameLayout.

It contains two Views elements: ImageView and TextView, and the later TextView is also contained in a RelativeLayout. There are many utilities available in the tools directory of Android, and here is one of the tools, hierarchyviewer, for viewing the current UI structural view.

After opening tools/hierarchyviewer.bat, look at the UI structure diagram of the above example to get:

We can clearly see that there are two framelayout nodes in the structure contained in the red wireframe, and it is obvious that these two nodes with exactly the same meaning cause a waste of resources. (we can remind you that you can habitually check the current allocation of UI resources through the Android mobile operating system in the development project.), then how to solve this problem (how to remove the redundant frameLayout nodes in the current example)? At this point, tags will be used to deal with similar problems. Let's replace the framLayout in the above xml code with merge:

After running the program, the effect is the same in the Android mobile operating system, but the UI structure viewed through hierarchyviewer has changed, and the original redundant FrameLayout nodes have been merged. Or it can be understood as adding a subset of the merge tag directly under the FrameLayout and node of the Activity.

It is important to note that the root node of all Activity views is frameLayout. If you create a Layout that does not use framLayout as the root node (but uses LinerLayout and so on to define root tags), you cannot use the above example to optimize the UI structure through merge.

The above is an example of the Android mobile operating system shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report