Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of Android Mobile phone operating system

Shulou Source: shulou.com Published: 2022-06-02 16:02:00 09月30日 Update

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.

Tags: Nodes elements operating systems mobile phones systems structures analysis size examples two graphics tags obvious above examples content tools browsers views resources Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Technology NVidia vpn Apple