Android's GUI system and experience
sharing
John Lu
2012/04/13
Agenda
Android GUI System architecture
Review: Service and Binder
How to start a application
Draw the application's view
SurfaceView for application's state
Experience sharing
Android GUI System architecture
Android GUI System architecture
Android GUI System architecture
Example
Review: Service and Binder
SDK-Service and Kernel-Service
Android's IPC: Binder
How to start a application
ActivityManagerService to start a applictation
process and start Activity.
When Application start that mean a Activity
start.
How to start a application
Start Process
How to start a application
A ActivityThread attach to ActivityManagerService.
From ActivityManagerService to start Activity.
Draw the application's view
SetContentView() in Activity.onCreate().
When create the surface?
When to draw our application view.
Surface for application's state
Surface's life is control by WindowManagerService.
Application's state will relate to surface.
Draw the application's view
Surface for application's state
WindowManagerService::relayoutWindow()
{
…
Surface = win.createSurfaceLocked();
// win is WindowState that create in WidowSession.add()
…
}
Surface for application's state
SurfaceSession
Experience sharing
AsyncTask dosen't work (Unidentified reason).
Dynamic Broadcast Receiver register and
unregister in Activity.
Surface used between in Create and Destroy.
Split the file in Assets if file over 1MByte.
Except the construct view object always work
between in onStart and onStop.
Experience sharing
onItemClick(AdapterView adapter, View
v, int position, int id), id is you need.
Dialog dismiss
Android Developers is your best friend
like Google. (e.g., Dev Guide, Resource,
etc.)
Summary
Android application manager is
ActivityManagerService.
Application GUI manager is
WindowManagerService.
View create need to before Activity resume.
Surface running between be created and
be destroyed.