Android Pen question two

Source: Internet
Author: User

1. Android System Architecture:

Linux kernel--standard library--framework Layer--Application layer

Linux tiers include: Core services of Android system, hardware driver, process management, system security, etc.

2. UI Interface Frame diagram:

3, the measurement mode of view: Exactly,at_most,unspecified.

4. What should I pay attention to when customizing view and ViewGroup?

When customizing the ViewGroup, you should pay attention to overriding onlayout to control where the subclass is displayed.

If you need to support wrap_content also rewrite onmeasure ().

When customizing the view, if you need to support wrap_content, you need to rewrite onmeasure ().


5. Types of Custom view:

(1), to expand the existing components

(2), by combining to implement the new control

(3), overriding view to implement a new control

6, the realization of sliding method:

(1), through the layout method.

(2), by Layoutparam to change the location of a view (must have a parent layout to be able to get to the component's Layoutparam).

(3), Scrollto,scrollby method. (Moving is the contents of the component, DX and dy if it is negative, then the content moves in the positive direction, positive numbers move in the negative direction).

(4), Scroller.

(5), property animation.

(6), Viewdraghelper

(7), offsetleftandright () offset both left and right.

Offsettopandbottom () offsets both up and down.

7, independent pixel DP and PX conversion:

The Android system uses MDPI, a screen with a density value of 160 as the standard, on this screen, 1PX=1PD, the direct conversion ratio of each resolution is:

Ldpi:mdpi:hdpi:xhdip:xxhdpi=3:4:6:8:12

8, the difference between Surfaceview and view:

(1), view is mainly used for active updates, and Surfaceview is mainly used for passive update situations, such as frequent refresh.

(2), the view is refreshed in the main thread, and the Surfaceview is refreshed by a sub thread.

(3), the view in the drawing time does not adopt the double buffering mechanism, but the Surfaceview has already realized the double buffering mechanism in the bottom realization mechanism.

9, the security mechanism of Android:

(1), the first line of defense: code security Mechanism-code obfuscation Proguard.

(2), the second line of defense: The Application access rights control--androidmainifest file permission Declaration, permission check mechanism.

(3), third line of defense: application signing Mechanism-digital certificate (Android system will not install unsigned apps).

(4), fourth line of defense: Linux kernel Layer Security mechanism--UID access control

(5), fifth line of Defense: Android Virtual machine sandbox mechanism--sandbox isolation

Android Pen question two

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.