AIDL:Android接口定义语言(Android Interface Definition Language)
IPC:进程间通信(Inter-Process Communication)
RPC:远程过程调用(Remote Procedure Call)
RPC(Remote Procedure Call)—远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。RPC协议假定某些传输协议的存在,如TCP或UDP,为通信程序之间携带信息数据。在OSI网络通信模型中,RPC跨越了传输层和应用层。RPC使得开发包括网络分布式多程序在内的应用程序更加容易。
RPC采用客户机/服务器模式。请求程序就是一个客户机,而服务提供程序就是一个服务器。首先,客户机调用进程发送一个有进程参数的调用信息到服务进程,然后等待应答信息。在服务器端,进程保持睡眠状态直到调用信息到达为止。当一个调用信息到达,服务器获得进程参数,计算结果,发送答复信息,然后等待下一个调用信息,最后,客户端调用进程接收答复信息,获得进程结果,然后调用执行继续进行。
NDK:一种工具集可以支持使用C,C++
The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++. For certain types of apps, this can help you reuse code libraries written in those languages.
OOM
Out Of Memory 内存溢出
AMS
ActivityManagerService
assets目录:
是Android的一种特殊目录,用于放置APP所需的固定文件,且该文件被打包到APK中时,不会被编码到二进制文件。assets文件夹下的文件不会被映射到R.java中,调用assets目录文件的方法请自行百度
bitmap位图
是Drawable的一种,Drawable是Android处理图像通用的类
在Android
中Bitamp
指的就是一张图片,一般是png
和jpeg
格式。
Bitmap
类中有一个enum
类型的Config
,其中有4个值
-
ALPHA_8
8位位图;1 个字节,只有透明度,没有颜色值 -
RGB_565
16位位图;2 个字节,r = 5,g = 6,b = 5,一个像素点 5+6+5 = 16 -
ARGB_4444
16位位图;2 个字节,a = 4,r = 4,g = 4,b = 4,一个像素点 4+4+4+4 = 16 -
ARGB_8888
32 位位图; 4个字节,a = 8,r = 8,g = 8, b = 8,一个像素点 8 + 8 + 8 + 8 = 32
每8位一个字节
Drawable
是一个抽象的可绘制类。一种可以在Canvas上进行绘制的抽象的概念
颜色、图片等都可以是一个Drawable
Drawable可以通过XML定义,或者通过代码创建
Android中Drawable是一个抽象类,每个具体的Drawable都是其子类
软件覆盖问题
一个看包名是否相同
一个是看build.gradle的
applicationId "com.example.administrator.testicon2"属性是否相同
应用图标
现在Android推荐圆形和方形带圆角两种,不推荐透明背景的图标,但透明背景也可以实现
ANR
Application Not Responding,也就是应用程序无响应
主线程进程耗时操作会导致ANR
ResolveInfo类
Information that is returned from resolving an intent against an IntentFilter. This partially corresponds to information collected from the AndroidManifest.xml's <intent> tags.
根据IntentFilter解析intent的一个匹配的结果(这部分对应于AndroidManifest<intent>标签中注册的信息)
例如 List<ResolveInfo> resInfoList = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);查找所有intent匹配结果
NetWorkInfo类
Describes the status of a network interface.
Use ConnectivityManager.getActiveNetworkInfo()
to get an instance that represents the current network connection.
用于描述网络接口状态的一个类
NetWork类
Identifies a Network
. This is supplied to applications via ConnectivityManager.NetworkCallback
in response to the active ConnectivityManager.requestNetwork(NetworkRequest, PendingIntent)
or passiveConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
calls. It is used to direct traffic to the given Network
, either on a Socket
basis through a targeted SocketFactory
or process-wide viaConnectivityManager.bindProcessToNetwork(Network)
.
识别网络的一个类,没怎么用过不熟悉
NetWorkRequest类
Defines a request for a network, made through NetworkRequest.Builder
定义了一个对网络的请求
LinkProperties类
Describes the properties of a network link. A link represents a connection to a network. It may have multiple addresses and multiple gateways, multiple dns servers but only one http proxy and one network interface. Note that this is just a holder of data. Modifying it does not affect live networks.
Android进程分类(按重要度分)
前台进程:
用户当前正在做的事情所必需的进程,符合以下条件视为前台进程
- It is running an
Activity
at the top of the screen that the user is interacting with (itsonResume()
method has been called). - It has a
BroadcastReceiver
that is currently running (itsBroadcastReceiver.onReceive()
method is executing). - It has a
Service
that is currently executing code in one of its callbacks (Service.onCreate()
,Service.onStart()
, orService.onDestroy()
).
极其重要,手机上只会有几个前台进程,只有当内存极度不足才会终止进程
可见进程:
可见进程正在做用户当前知道的操作,终止该进程会造成很差的用户体验,符合以下条件视为可见进程
- It is running an
Activity
that is visible to the user on-screen but not in the foreground (itsonPause()
method has been called). This may occur, for example, if the foreground Activity is displayed as a dialog that allows the previous Activity to be seen behind it. - It has a
Service
that is running as a foreground service, throughService.startForeground()
(which is asking the system to treat the service as something the user is aware of, or essentially visible to them). - It is hosting a service that the system is using for a particular feature that the user is aware, such as a live wallpaper, input method service, etc.
也很重要但低于前台进程,不容易被系统终止
服务进程:
含有一个正在执行的服务,会随着服务执行的时间重要度降低,直到降为cached LRU,这有助于避免内存泄露和使用过多的RAM
系统一般会保证该进程的运行
缓存进程:
缓存进程是当前不需要的进程,一般系统会存在多个缓存进程,并根据内存需要定期从最老的缓存进程开始终止
例如Activity处于停止状态(onStop已经调用)会进入缓存进程
缓存进程保存在pseudo-LRU list(伪最近最少使用列表)中,系统会第一个终止排在pseudo-LRU list中最后一个进程