Android is an open source, Linux-based software stack created for a wide array of devices and form factors.
Android 是一个开源的,基于Linux的用于针对不同尺寸的移动设备创建界面的软件堆栈。
系统架构:
Application层: 也就是应用层,不仅包括通话短信联系人这种系统级的应用,还包括用户自己安装的一些第三方应用
Framework层:这一层大部分用Java写的,包括系统服务和四大组件
Library层:这一层大部分都是C/C++写的,主要是虚拟机,还有一些三方库比如SQLite, WebKit
HAL层:硬件抽象层,
Linux内核层:包含Linux内核和一些驱动,比如说蓝牙驱动,Camera驱动等等,这个Binder驱动也是在这一层
The Android platform provides a framework API that applications can use to interact with the underlying Android system.
The framework API consists of:
Android platform 提供了一个让应用可以和底层Android系统进行交互的API框架。
Updates to the framework API are designed so that the new API remains compatible with earlier versions of the API.
two case:
更新API框架被设计以便于新老API可以兼容。
有两种情况:
API Level ≠ Android Platform Version
minSdkVersion:最小的API Level。
targetSdkVersion:目标SDK版本,建议使用最新。
compileSdkVersion:编译工程的SDK版本。不应该比targetSdkVersion低。
maxSdkVersion:最大的API Level。
A layout resource defines the architecture for the UI in an Activity or a component of a UI
布局资源定义了Activity或UI组件中UI的体系结构
The View class represents the basic building block for UI components.
There are many specialized subclasses of views that act as controls or are capable of displaying text, images, or other content.
View类代表UI组件的基本构建块。
有许多专用的视图子类可以充当控件或能够显示文本,图像或其他内容。
View Class的通用属性:
IDs:
“@+id/idName” – 例如 @+id/mybutton
“@id/idName” – 例如 @id/mybutton
android:layout_height 和 android:layout_width
尺寸值:
基于屏幕物理尺寸的单位:in,mm,pt。1 in = 25.4 mm = 72 pt。他们无法在所有设备上正常运行。
基于像素:Pixel(像素),Resolution(分辨率),Pixel Density:(像素密度 dpi)
px,dp,sp。px = dp * (dpi / 160)
match_parent:该视图希望与父视图一样大(减去父视图的填充,如果有的话)
wrap_content:视图要足够大以包围其内容(考虑其自身的填充)
Padding
它定义了视图边缘和视图内容之间的空间
android:paddingTop 上
android:paddingBottom 下
android:paddingLeft 左
android:paddingRight 右
android:paddingStart 基于ui设置
andorid:paddingEnd 基于ui设置
View Group Class包含其他视图的特殊视图
属性:
属性:
理解活动的生命周期:
onCreate()
本文地址:https://blog.csdn.net/qq_41202539/article/details/107500118
如对本文有疑问, 点击进行留言回复!!
如何在Ubuntu 18.04(实体机)上配置OpenWRT的开发环境
网友评论