android core system
2016-08-11 08:55:38 0 举报
AI智能生成
Android Core System是Android操作系统的核心部分,它包含了所有基本的应用程序和服务,如电话、短信、相机、浏览器等。这些组件由Android开源项目提供,并由Google进行维护和更新。Android Core System还提供了一些基本的开发工具和API,使开发人员可以轻松地创建新的应用程序和服务。此外,Android Core System还支持多种硬件平台和设备,包括手机、平板电脑、智能手表等。总之,Android Core System是Android操作系统的基础,它为用户提供了丰富的功能和服务,同时也为开发人员提供了一个强大的开发平台。
作者其他创作
大纲/内容
UI
Layout
FrameLayout
ViewFlipper
ViewSwticher
LinearLayout
AbsoluteLayout
RelativeLayout
TableLayout
GridLayout(4.0)
Fragment(3.0)
View
TextView
EditText
Button
Radio
Checkbox
Toggle
ImageView
ImageButton
Progressbar
Seekbar
Ratingbar
Date
Date
Time
WebView
AdapterView
ListView
ViewHolder
contentView
CacheMap
aysncTask
scrollListener
mulit-item
分组
分页
Header
Footer
PinnedHeaderView
pull-refresh-view
GridView
Spinner
ViewPager
Gallery
自定义View
可以重写的方法:
onFinishInflate() 这是一个回调方法,当应用从XML文件加载该组件并利用它来构建界面之后,该方法会被调用。
onMeasure(int, int) 调用该方法来检测View组件及它所包含的所有子组件的大小。
onLayout(boolean, int, int, int, int) 当该组件需要分配其子组件的位置、大小时,该方法会被回调。
onSizeChanged(int, int, int, int) 当该组件的大小被改变时调用该方法。
onDraw(Canvas) 该组件将要绘制它的内容时回调该方法进行绘制。
onKeyDown(int, KeyEvent) 当某个键被按下时调用该方法。
onKeyUp(int, KeyEvent) 当松开某个键时调用该方法。
onTrackballEvent(MotionEvent) 当发生轨迹球事件时触发该方法。
onTouchEvent(MotionEvent) 当发生触摸事件时触发该方法。
onWindowFocusChanged(boolean) 当组件得到、失去焦点时触发该方法。
onAttachedToWindow() 当该组件放入某个窗口时触发该方法。
onDetachedFromWindow() 当该组件从某个窗口上分离时触发该方法。
onWindowVisibilityChanged(int) 当包含该组件的窗口可见性发生改变时触发该方法。
通知系统
Notification
Dialog
Toast
自定义组件
Appwidget
PopupWindow
SystemManager
AssetManager
ActivityManager
PackageManager
WindowManager
NotificationManager
FragmentManager
AppwidgetManager
传感器
光线
加速度、GPS、方向、近距离、磁
AndroidManifast.xml
appcation
Activity
launchmode
singletask
singletop
singleinstance
standard
Service
BroadcastReceiver
ContentProvider
version
user-permission
SDK Version
Intent
bundle
保存数据
map
putExtras
显式
startActivity
startService
明确指出需要触发和启动的组件的名称
隐式
action
package+ACTION_XXX
category
LAUNCHER
DEFAULT
data
data
schema
host
path
port
type
image/jpg
通信载体
ContentProvider
ContentResolver
insert(Uri, ContentValues)
delete(Uri, ContentValues)
update(Uri, ContentValues, String, String[])
query(Uri, String[], String, String[],String[])
自定义
extends ContentProvider
Activity
生命周期
Test1Activity->Test2Activity->Test3Activity
onCreate()
onStart()
onResume()
onPause()
onCreate()
onStart()
onResume()
onStop()
onPause()
onCreate()
onStart()
onResume()
onStop()
onPause()
onRestart()
onStart()
onResume()
onStop()
onDestroy()
onPause()
onRestart()
onStart()
onResume()
onStop()
onDestroy()
Test1Activity->Test2Activity(半透明)
onCreate()
onStart()
onResume()
onPause()
onCreate()
onStart()
onResume()
onPause()
onResume()
onStop()
onDestroy()
Test1Activity->Test2Activity(半透明)->Test3Activity
onCreate()
onStart()
onResume()
onPause()
onCreate()
onStart()
onResume()
onPause()
onStop()
onCreate()
onStart()
onResume()
onStop()
onPause()
onRestart()
onStart()
onRestart()
onStart()
onResume()
onStop()
onDestroy()
onPause()
onResume()
onStop()
onDestroy()
跳转
内部
Visible
Fragment
addView
setContentView
页面
startActivity
startActivityForResult
requestCode
reponseCode
setResult(int resultCode, Intent data)
onActivityResult
是Android中负责与用户交互的组件
横竖屏切换
竖屏切横屏
不设置configChanges时onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume->
横屏切竖屏
不设置android:configChanges时,切屏时会调用各个生命周期,横屏时调用一次,竖屏时调用两次。
竖屏到横屏:onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume
横屏到竖屏:onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume->onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume->
设置android:configChanges="orientation"时,切屏还会调用各个生命周期,横屏和竖屏都调用一次。
竖屏到横屏:onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume
横屏到竖屏:onSaveInstanceState->onPause->onStop->onDestroy->onCreate->onStart->onRestoreInstanceState->onResume->onConfigurationChanged
设置android:configChanges="orientation|keyboardHidden"时,切屏时不会调用各个生命周期,只会执行onConfigurationChanged方法。
只会执行onConfigurationChanged
Service
生命周期
启动方法
startService()
onCreate->onStart->running->onDestory
多次调用startService()只执行一次onCreate,但是调用一次执行一次onStart
stopService()结束
bindService()
onCreate->onBind->running->onUnbind->onDestroy
onBind只会触发一次
unbindService()结束
如果有新的客户端连接到该服务,只有执行完当前的onUnbind后才会执行onRebind
通常位于后台运行,一般不需要与用户进行交互,因此没有图形用户界面
BroadcastReceiver
注册
Java代码Content.registReceiver()
AndroidManifest.xml中
无序
sendBroadcast()、sendStickyBroadcast()、sendOrderedBroadcast()
有序广播

收藏

收藏
0 条评论
下一页