Android


You can download the Android SDK bundled with eclipse for a windows operating system from here.

                APPS
-------------------------------------------------
       APPS FRAMEWORK
-------------------------------------------------
LIBRARIES | ANDROID RUNTIME
-------------------------------------------------
              KERNEL
     Android Apps
----------
Dalvik VM
-------
Process
-------
Android kernel



Hardware abstraction Layer: display, touch input, network, powerm storage
IPC: interprocess communication. shared object life cycle
yet another file system
block

Android java virtual machine: Dalvik on top of the Android kernel
JVM compatible bytecode (.class), dalvik executable (.dex) run by Dalvik VM

Libraries: C library (libC) freetype (rendering text to bitmap), SQLite (DB) OpenGL(2D/3D rendering using hardware accelation if available), LibWebCore (a WebKit based browser engine which can be embeded as a web view within user interfaces of other applications. it is used in the develpment of the stock android browser) Andoid media libraries

Apps framework:
view manager: user interfaces,
content provider: resources storastio nand sharing
notification manager: API
NoticficationManager class: place icon on status bar(clickable, register executable actions), turn back light on, vibrate, play sounds
LocationManager
identify location
register location-based triggers that are called in proximity
input method service: your own keyboard, any custom buttons, pen inputs, etc. the input is then converted into text and passed to the taget UI elements
telephony manager
Apps can subscribeto telephony state changes
SmsManager
Utilities: PhoneNumberUtils, PhonenumberFormattingTextWatcher (format phone numbers from around the world)
power manager
PowerManager.WakeLock forces devices to remain on.
Disable lock as son as possible.
by definition everything is powering down to save energy
Resource Manager Framework
Decouples static resources and device specifics from apps
    layout, animation, strings, sounds, images, etc.
    To access resource: <packagename>.R.<resourcetype>.<resourcename>               R=Resurcemanagerclass, resourcetype is pre defined
text subview, rectangle, subview with text and icons,
View class -> ViewGroup class


Components
Activity(action)      Service      Content Provider(data)      Broadcast Receiver(action)
------------------------------------------------------------------------------------------
                                    intent(interaction among above)
Activity class
one activity per UI
Can call other activity of another app
email app asks a pdf viewer app to view a pdf attachment via Intent communication

Intent
an object: intended request + parameters
intent i = new intent(FirstActivity.class, SecondActivity.class);
startActivity(i);
Explicit intents: run various internal activities whie user is interacting
implicit intent: only enough info for system to etermine which component is better to receive th eintent or which activity should be started to receive the intent (requires intent filters)

Action: A String naming the action to be performed
 constant target component
 action description
 ACTION_CLASS activity 
  ACTION_EDIT activity 
  ACTION_MAIN activity 
  ACTION_SYNC activity 
  ACTION_BATTERY_LOW
broadcast receiver
 
   ACTION_HEADSET_PLUG  
   ACTION_  

Category: A String containing additional info about the kind of comonent thatshoild handle the intent
 constants
 meaning
 CATEGORY_BROWSABLE target category invoked by the browser to display data
 CATEGORY_GADGET
 
  CATEGORY_HOME 
  CATEGORY_LAUNCHER 
  CATEGORY_PREFERENCE 

Parameters (Data): URI of data and MIME type


iNTENT Filter

which implicit intents they can handle, activities, services, broadcast receivers
Android system itself utilizes intent filters to

Services
unlike activities, services are used for background, UI-less task that do not require user interaction
service class
background mp3 player
profiler that tells you which apps are more power hungry
similar to activity start service use intents
should be declared in the AndroidManifest.xml
startService() to start it in your own app
bindService() start a service in another app
bound services are servers in client-server interaction scenario

services run in the main thread of the hosting process, usuallyly start a thread and bind in that thread.
cpu intevsive mp3 playback, or network block etc.

Content Provider
sharable content
app packages data as content providershare data with other apps via ContentResolver interface
e.g. contacts are stored as content providers so taht they are accessible by others

broadcastReceiver
responding to system wide broadcast announcements
devicebattery status, camera just captured an image
each broadcast is represented as an intent object , it is an implicit intent

-----------------
Dalvik Debug monitor service DDMS graphical information of running threads and calls stack
Android debug bridge adb : debug on actual device tethered aconnected by wire or an emulator
   device | adb | DDMS, eclipse plugin, etc.
TraceView tool: graphical iew of app executiin log
HierarchyViewer






Comments