Android Window: easy to learn and organize 1. androidwindow

Source: Internet
Author: User

Android Window: easy to learn and organize 1. androidwindow


1. Relationship between Activity, Window, and View
The Android Graphical User Interface (GUI) follows the general rules of GWES (Graphic window Event System) and manages User input (Event Management) and System screen output (window and interface drawing.
In Android development, if you want to display an interface, you will first write an Activtiy subclass, so all of them are understood as Activity is an interface, which is a broad term. The system is responsible for creating development and writing Activity subclasses. Activity creation creates a Window object (usually PhoneWindow), and a View object (DecorView) is added during Window creation ). Therefore, the relationship between the three is Activity-> Window-> View. The following briefly describes the main responsibilities of the three (see the three official documents ):
Activity: the boss of an application display interface. It is not responsible for Screen Display and is mainly used for interaction with the Android system. Window: displays the layout (whether multiple windows are displayed at the upper or lower level, or even at the upper or lower level), display level, and event processing. View: controls how to draw events in a specific View area and View area.

Ii. Window System
Windows Management for Android is in Client/Server (C/S) mode.
ClientActivity opens a session (opens the IWindowSession AIDL Interface) and adds the Window to WindowManager through this interface.
Server adds a window to WindowManager
Windows Management erserviceandroid design considerations:
Window z-order Management (how to overlay Windows)
Calculation of the activity window and notification of changes
Window owner (which application belongs)
Input Method management



Iii. Window Type and hierarchy
WindowManagerService-> IWindow <-ViewRoot (View variable and token are used for IPC Communication)
Window type. The larger the int value, the closer it is to display
Window Type Creation Method Value Range
Application Window The Activity is created internally. 1 ~ 99
Subwindow Created by the parent window 1000 ~ 1999
System window The system determines that only one layer is displayed. 2000 ~ 2999


Reference: Android core analysis (12) ----- basic architecture of Android GEWS Window Management

Android core analysis (13) ----- Android GWES-Android Window Management

Analysis of Android kernel by Ke Xinnian's chapter 8th window creation process Chapter 2 Working Principle of WindowManagerService

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.