SlideShare une entreprise Scribd logo
1  sur  57
Télécharger pour lire hors ligne
Marko	
  Gargenta	
  
Android	
  Deep	
  Dive	
  
Sprint	
  Dev	
  Con	
  2010	
  
About	
  Marko	
  Gargenta	
  
Developed Android Bootcamp for Marakana.
Taught over 1,000 developers on Android.
Clients include Qualcomm, Sony-Ericsson, Motorola,
Texas Instruments, Cisco, Sharp, DoD.
Author of upcoming Learning Android by O’Reilly.
Spoke at OSCON, ACM, IEEE, SDC.
Organizes SFAndroid.org
Agenda	
  
•  The	
  Stack	
  
•  Hello	
  World!	
  
•  Main	
  Building	
  Blocks	
  
•  Android	
  User	
  Interface	
  
•  OperaFng	
  System	
  
Features	
  
•  Debugging	
  and	
  Tools	
  
•  Summary	
  
ANDROID	
  STACK	
  
The	
  Stack	
  
Linux	
  Kernel	
  
Android runs on Linux.
Linux provides:
Hardware abstraction layer
Memory management
Process management
Networking
Users never see Linux sub system
The adb shell command opens
Linux shell
Linux Kernel
Libraries
Application Framework
Applications
Home Contacts Phone Browser Other
Activity
Manager
Window
Manager
Content
Providers
View
System
Package
Manager
Telephony
Manager
Resource
Manager
Location
Manager
Notiication
Manager
Surface
Manager
OpenGL
SGL
Media
Framework
FreeType
SSL
SQLite
WebKit
libc
Android Runtime
Core Libs
Delvik
VM
Display
Driver
Keypad
Driver
Camera
Driver
WiFi
Driver
Flash
Driver
Audio
Driver
Binder
Driver
Power
Mgmt
NaFve	
  Libraries	
  
Pieces borrowed from other
open source projects:
Bionic, a super fast and small
license-friendly libc library optimized
for Android
WebKit library for fast HTML
rendering
OpenGL for graphics
Media codecs offer support for
major audio/video codecs
SQLite database
Much more…
Linux Kernel
Libraries
Application Framework
Applications
Home Contacts Phone Browser Other
Activity
Manager
Window
Manager
Content
Providers
View
System
Package
Manager
Telephony
Manager
Resource
Manager
Location
Manager
Notiication
Manager
Surface
Manager
OpenGL
SGL
Media
Framework
FreeType
SSL
SQLite
WebKit
libc
Android Runtime
Core Libs
Delvik
VM
Display
Driver
Keypad
Driver
Camera
Driver
WiFi
Driver
Flash
Driver
Audio
Driver
Binder
Driver
Power
Mgmt
Dalvik	
  
Dalvik VM is Android implementation of
Java VM
Dalvik is optimized for mobile devices:
• Battery consumption
• CPU capabilities
Key Dalvik differences:
• Register-based versus stack-based VM
• Dalvik runs .dex files
• More efficient and compact implementation
• Different set of Java libraries than JDK
ApplicaFon	
  Framework	
  
The rich set of system services
wrapped in an intuitive Java API.
This ecosystem that developers
can easily tap into is what makes
writing apps for Android easy.
Location, web, telephony, WiFi,
Bluetooth, notifications, media,
camera, just to name a few.
Linux Kernel
Libraries
Application Framework
Applications
Home Contacts Phone Browser Other
Activity
Manager
Window
Manager
Content
Providers
View
System
Package
Manager
Telephony
Manager
Resource
Manager
Location
Manager
Notiication
Manager
Surface
Manager
OpenGL
SGL
Media
Framework
FreeType
SSL
SQLite
WebKit
libc
Android Runtime
Core Libs
Delvik
VM
Display
Driver
Keypad
Driver
Camera
Driver
WiFi
Driver
Flash
Driver
Audio
Driver
Binder
Driver
Power
Mgmt
ApplicaFons	
  
Dalvik Executable + Resources = APK
Must be signed (but debug key is okay
for development)
Many markets with different policies
Android	
  and	
  Java	
  
Android Java
=
Java SE
–
AWT/Swing
+
Android API
Android	
  SDK	
  -­‐	
  What’s	
  In	
  The	
  Box	
  
SDK
Tools
Docs
Platforms
Data
Skins
Images
Samples
Add-ons
Google
HELLO	
  WORLD!	
  
Create	
  New	
  Project	
  
Use the Eclipse tool to create a new
Android project.
Here are some key constructs:
Project	
   Eclipse	
  construct	
  
Target	
   minimum	
  to	
  run	
  
App	
  name	
   whatever	
  
Package	
   Java	
  package	
  
AcFvity	
   Java	
  class	
  
Anatomy	
  
of	
  An	
  App	
  
Java Code
+
XML and Other
Resources
+
Manifest File
=
Android App
The	
  Manifest	
  File	
  
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.marakana"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".HelloAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="5" />
</manifest>
The	
  Layout	
  Resource	
  
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
The	
  Java	
  File	
  
package com.marakana;
import android.app.Activity;
import android.os.Bundle;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Running	
  on	
  Emulator	
  
Emulator, not a simulator
MAIN	
  BUILDING	
  BLOCKS	
  
AcFviFes	
  
Android Application
Main Activity
Another
Activity
Another
Activity
An Activity
represents a screen
or a window. Sort of.
AcFvity	
  Lifecycle	
  
Starting
Running
PausedStopped
Destroyed
(1) onSaveInstanceState()
(2) onPause()
(3) onResume()
(2) onStart()
(1) onRestart() onResume()
(1) onSaveInstanceState()
(2) onStop()
<process killed>
onDestroy()
or
<process killed>
(1) onCreate()
(2) onStart()
(3) onRestoreInstanceState()
(4) onResume()
Activities have a well-
defined lifecycle. The
Android OS manages
your activity by
changing its state.
You fill in the blanks.
Intents	
  
Android Application
Another
Activity
Android Application
Main Activity
Intent
Intent
Main Activity
Intent
Another
Activity
Intents represent
events or actions.
They are to
Android apps what
hyperlinks are to
websites. Sort of.
Intents can be
implicit or explicit.
Services	
  
Services are code that runs in the background. They
can be started and stopped. Services doesn’t have
UI.
Service	
  Lifecycle	
  
Service also has a lifecycle, but it’s
much simpler than activity’s.
An activity typically starts and stops a
service to do some work for it in the
background, such as play music,
check for new tweets, etc.
Services can be bound or unbound.
Content	
  Providers	
  
Content
Provider
Content URI
insert()
update()
delete()
query()
Content Providers share
content with applications
across application
boundaries.
Examples of built-in
Content Providers are:
Contacts, MediaStore,
Settings and more.
Broadcast	
  Receivers	
  
An Intent-based publish-subscribe mechanism. Great for listening
system events such as SMS messages.
Twitter.com
MyTwitter
Activity
Updater
Service
Timeline
Receiver
Timeline
DB
Prefs
XML
Updates
Status via
web service
Preference
Activity
Pull timeline
updates via
web service
Insert
updates
in DB
Notify of
new status
Timeline
Activity
Pull timeline
from DB
Update list
Timeline
Adapter
Update ListView
Read/write
preferences
Boot
Receiver
Start at
boot
Read
Prefs
Read
Prefs
Yamba	
  –	
  A	
  Real	
  World	
  App	
  
ANDROID	
  USER	
  INTERFACE	
  
Two	
  UI	
  Approaches	
  
Procedural	
   DeclaraCve	
  
You	
  write	
  Java	
  code	
  
Similar	
  to	
  Swing	
  or	
  AWT	
  
You	
  write	
  XML	
  code	
  
Similar	
  to	
  HTML	
  of	
  a	
  web	
  page	
  
You can mix and match both styles. Best practice:
• Start with XML and declare most of UI
• Switch to Java and implement the UI logic
XML-­‐Based	
  User	
  Interface	
  
Use WYSIWYG tools to build powerful XML-based UI.
Easily customize it from Java. Separate concerns.
Common	
  View	
  ProperFes	
  
Layout	
  Width	
   FILL_PARENT,	
  WRAP_CONTENT or	
  a	
  specific	
  size	
  in	
  units.	
  
Layout	
  Height	
   FILL_PARENT,	
  WRAP_CONTENT or	
  a	
  specific	
  size	
  in	
  units.	
  
Layout	
  Weight	
   How	
  greedy	
  or	
  generous	
  a	
  widget	
  is.	
  Value	
  is	
  0	
  to	
  1.	
  
Layout	
  Gravity	
   How	
  to	
  align	
  widget	
  within	
  parent	
  
Gravity	
   How	
  to	
  align	
  content	
  of	
  widget	
  within	
  itself	
  
Id	
   Unique	
  id	
  of	
  this	
  widget,	
  usually	
  @+id/someUniqueId!
Text	
   Text	
  for	
  the	
  content	
  of	
  the	
  component,	
  usually	
  @string/myText!
Dips	
  and	
  Sps	
  
px	
  (pixel)	
   Dots	
  on	
  the	
  screen	
  
in	
  (inches)	
   Size	
  as	
  measured	
  by	
  a	
  ruler	
  
mm	
  (millimeters)	
   Size	
  as	
  measured	
  by	
  a	
  ruler	
  
pt	
  (points)	
   1/72	
  of	
  an	
  inch	
  
dp	
  (density-­‐independent	
  pixel)	
   Abstract	
  unit.	
  On	
  screen	
  with	
  160dpi,	
  1dp=1px	
  
dip	
   synonym	
  for	
  dp	
  and	
  oeen	
  used	
  by	
  Google	
  
sp	
   Similar	
  to	
  dp	
  but	
  also	
  scaled	
  by	
  users	
  font	
  size	
  
preference	
  
Views	
  and	
  Layouts	
  
Layouts contain widgets and other
layouts forming a “composite” pattern.
Linear	
  Layout	
  
One of the most commonly
used layouts. It lays its
children next to each other,
either horizontally or vertically.
RelaFve	
  Layout	
  
Children of relative layout are
placed in relationship to each
other. This layout is efficient.
Table	
  Layout	
  
Table layout puts its children
into table rows and columns.
It is similar to an HTML table.
Frame	
  Layout	
  
Frame layout places its
children on top of each other,
like a deck of cards. It is
useful for widgets such as
tabs or as a placeholder for
views added
programmatically.
Common	
  UI	
  Components	
  
Android UI includes many
common modern UI
widgets, such as Buttons,
Tabs, Progress Bars, Date
and Time Pickers, etc.
SelecFon	
  Components	
  
Some UI widgets may
be linked to zillion
pieces of data.
Examples are ListView
and Spinners
(pull-downs).
Adapters	
  
To make sure they run smoothly, Android uses
Adapters to connect them to their data sources. A
typical data source is an Array or a Database.
Data
Source
Adapter
Complex	
  Components	
  
Certain high-level components are simply
available just like Views. Adding a Map or a
Video to your application is almost like adding a
Button or a piece of text.
Menus	
  and	
  Dialogs	
  
Graphics	
  &	
  AnimaFon	
  
Android has rich support for 2D graphics.
You can draw & animate from XML.
You can use OpenGL for 3D graphics.
MulFmedia	
  
AudioPlayer lets you simply specify
the audio resource and play it.
VideoView is a View that you can
drop anywhere in your activity, point
to a video file and play it.
XML:
<VideoView
android:id="@+id/video"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center” />
Java:
player = (VideoView) findViewById(R.id.video);
player.setVideoPath("/sdcard/samplevideo.3gp");
player.start();
OPERATING	
  SYSTEM	
  FEATURES	
  	
  
Security	
  
Android Application
Prefs
DB
File
System
Linux Process
Each Android application
runs inside its own Linux
process.
Additionally, each application
has its own sandbox file
system with its own set of
preferences and its own
database.
Other applications cannot
access any of its data,
unless it is explicitly shared.
File	
  System	
  
The file system has three main mount points. One
for system, one for the apps, and one for whatever.
Each app has its own sandbox easily accessible to
it. No one else can access its data. The sandbox is
in /data/data/com.marakana/
SDCard is expected to always be there. It’s a good
place for large files, such as movies and music.
Everyone can access it.
Cloud	
  to	
  Device	
  Push	
  
Big deal for many pull-based apps. Will make devices use less battery.
Preferences	
  
Your app can support complex
preferences quite easily.
You define your preferences in an
XML file and the corresponding UI and
data storage is done for free.
SQLite	
  Database	
  
Android ships with SQLite3
SQLite is a
• Zero configuration
• Serverless
• Single database file
• Cross-Platform
• Compact
• Public Domain
Database engine.
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
DEBUGGING	
  	
  
ANDROID	
  APPS	
  
LogCat	
  
The universal, most
versatile way to track
what is going on in
your app.
Can be viewed via
command line or
Eclipse.
Logs can be
generated both from
SDK Java code, or
low-level C code via
Bionic libc extension.
Debugger	
  
Your standard debugger is included in SDK, with all the usual bells & whistles.
TraceView	
  
TraceView helps you profile you application and find bottlenecks. It shows
execution of various calls through the entire stack. You can zoom into specific
calls.
Hierarchy	
  Viewer	
  
Hierarchy Viewer helps
you analyze your User
Interface.
Base UI tends to be the
most “expensive” part of
your application, this tool
is very useful.
Summary	
  
Android is open and complete system for
mobile development. It is based on Java
and augmented with XML.
Android is being adopted very quickly
both by users, carriers, and
manufacturers.
It takes about 3-5 days of intensive
training to learn Android application
development for someone who has basic
Java (or similar) experience.
Licensed under Creative Commons
License (cc-by-nc-nd) – non-commercial.
Please Share!
Marko Gargenta, Marakana.com
marko@marakana.com
+1-415-647-7000

Contenu connexe

Tendances

Android: A 9,000-foot Overview
Android: A 9,000-foot OverviewAndroid: A 9,000-foot Overview
Android: A 9,000-foot OverviewMarko Gargenta
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The PhoneMarko Gargenta
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To AndroidGoogleTecTalks
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaMarakana Inc.
 
2011 android
2011 android2011 android
2011 androidvpedapolu
 
The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009Viswanath J
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21dxsaki
 
Android architecture
Android architectureAndroid architecture
Android architectureHari Krishna
 
Droid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroidcon Berlin
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0Premchander Rao
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Androidma-polimi
 
Android : How Do I Code Thee?
Android : How Do I Code Thee?Android : How Do I Code Thee?
Android : How Do I Code Thee?Viswanath J
 
Connected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryConnected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryTalentica Software
 
Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)denian00
 
Qt - for stack overflow developer conference
Qt - for stack overflow developer conferenceQt - for stack overflow developer conference
Qt - for stack overflow developer conferenceNokia
 
Meego의 현재와 미래(2)
Meego의 현재와 미래(2)Meego의 현재와 미래(2)
Meego의 현재와 미래(2)mosaicnet
 
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.DALEZ
 
Qt S60 Technical Presentation Fn Stripped
Qt S60 Technical Presentation Fn StrippedQt S60 Technical Presentation Fn Stripped
Qt S60 Technical Presentation Fn StrippedNokia
 

Tendances (20)

Android: A 9,000-foot Overview
Android: A 9,000-foot OverviewAndroid: A 9,000-foot Overview
Android: A 9,000-foot Overview
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The Phone
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 
2011 android
2011 android2011 android
2011 android
 
The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009The anatomy and philosophy of Android - Google I/O 2009
The anatomy and philosophy of Android - Google I/O 2009
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Droid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtimeDroid con berlin_the_bb10_android_runtime
Droid con berlin_the_bb10_android_runtime
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Android
 
Android : How Do I Code Thee?
Android : How Do I Code Thee?Android : How Do I Code Thee?
Android : How Do I Code Thee?
 
Connected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryConnected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discovery
 
Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)
 
Qt - for stack overflow developer conference
Qt - for stack overflow developer conferenceQt - for stack overflow developer conference
Qt - for stack overflow developer conference
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Meego의 현재와 미래(2)
Meego의 현재와 미래(2)Meego의 현재와 미래(2)
Meego의 현재와 미래(2)
 
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.
Forum Nokia Dev. Camp - WRT training Paris_17&18 Nov.
 
Qt S60 Technical Presentation Fn Stripped
Qt S60 Technical Presentation Fn StrippedQt S60 Technical Presentation Fn Stripped
Qt S60 Technical Presentation Fn Stripped
 

En vedette

Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaMarko Gargenta
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-pptSrijib Roy
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentBenny Skogberg
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my collegeSneha Lata
 
The Shaping Of American Education
The Shaping Of American EducationThe Shaping Of American Education
The Shaping Of American Educationjks7316
 
Top 10 Power Point Answers
Top 10 Power Point AnswersTop 10 Power Point Answers
Top 10 Power Point Answerspeliasen
 
Va Invit La Botezul Meu Ppt
Va Invit La Botezul Meu PptVa Invit La Botezul Meu Ppt
Va Invit La Botezul Meu Pptguest5dce4c5
 
Powerpoint Sample
Powerpoint SamplePowerpoint Sample
Powerpoint SampleCPW
 
Mikado + Kanban
Mikado + KanbanMikado + Kanban
Mikado + KanbanPaul Boos
 

En vedette (20)

Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, Marakana
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Android ppt
Android pptAndroid ppt
Android ppt
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my college
 
Android seminar ppt
Android seminar pptAndroid seminar ppt
Android seminar ppt
 
Android ppt
Android pptAndroid ppt
Android ppt
 
The Shaping Of American Education
The Shaping Of American EducationThe Shaping Of American Education
The Shaping Of American Education
 
Top 10 Power Point Answers
Top 10 Power Point AnswersTop 10 Power Point Answers
Top 10 Power Point Answers
 
South Africa: A Nation in Denial?
South Africa: A Nation in Denial? South Africa: A Nation in Denial?
South Africa: A Nation in Denial?
 
Va Invit La Botezul Meu Ppt
Va Invit La Botezul Meu PptVa Invit La Botezul Meu Ppt
Va Invit La Botezul Meu Ppt
 
Movie
MovieMovie
Movie
 
Powerpoint Sample
Powerpoint SamplePowerpoint Sample
Powerpoint Sample
 
Shannons Photo
Shannons PhotoShannons Photo
Shannons Photo
 
BlueTooth Marketing Device BT-Pusher Standard User Guide
BlueTooth Marketing Device BT-Pusher Standard User GuideBlueTooth Marketing Device BT-Pusher Standard User Guide
BlueTooth Marketing Device BT-Pusher Standard User Guide
 
Works Examples
Works ExamplesWorks Examples
Works Examples
 
MS Presov
MS PresovMS Presov
MS Presov
 
Mikado + Kanban
Mikado + KanbanMikado + Kanban
Mikado + Kanban
 
Teatro 2009
Teatro 2009Teatro 2009
Teatro 2009
 

Similaire à Android Deep Dive

Android overview
Android overviewAndroid overview
Android overviewHas Taiar
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A NutshellTed Chien
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architectureDilip Singh
 
Android- Introduction for Beginners
Android- Introduction for BeginnersAndroid- Introduction for Beginners
Android- Introduction for BeginnersTripti Tiwari
 
Android Workshop_1
Android Workshop_1Android Workshop_1
Android Workshop_1Purvik Rana
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptxmuthulakshmi cse
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User InterfaceMarko Gargenta
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Lars Vogel
 
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...RIA RUI Society
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptxallurestore
 

Similaire à Android Deep Dive (20)

PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android overview
Android overviewAndroid overview
Android overview
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
 
Android- Introduction for Beginners
Android- Introduction for BeginnersAndroid- Introduction for Beginners
Android- Introduction for Beginners
 
Android Workshop_1
Android Workshop_1Android Workshop_1
Android Workshop_1
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptx
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User Interface
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
 
Android primer
Android primerAndroid primer
Android primer
 
Android Introduction by Kajal
Android Introduction by KajalAndroid Introduction by Kajal
Android Introduction by Kajal
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptx
 
Android
Android Android
Android
 
Android Basic
Android BasicAndroid Basic
Android Basic
 

Plus de Marko Gargenta

LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer AppsMarko Gargenta
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developersMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 

Plus de Marko Gargenta (6)

LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer Apps
 
Java Champion Wanted
Java Champion WantedJava Champion Wanted
Java Champion Wanted
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developers
 
Scrum Overview
Scrum OverviewScrum Overview
Scrum Overview
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 

Dernier

PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum ComputingGDSC PJATK
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 

Dernier (20)

PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum Computing
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 

Android Deep Dive

  • 1. Marko  Gargenta   Android  Deep  Dive   Sprint  Dev  Con  2010  
  • 2. About  Marko  Gargenta   Developed Android Bootcamp for Marakana. Taught over 1,000 developers on Android. Clients include Qualcomm, Sony-Ericsson, Motorola, Texas Instruments, Cisco, Sharp, DoD. Author of upcoming Learning Android by O’Reilly. Spoke at OSCON, ACM, IEEE, SDC. Organizes SFAndroid.org
  • 3. Agenda   •  The  Stack   •  Hello  World!   •  Main  Building  Blocks   •  Android  User  Interface   •  OperaFng  System   Features   •  Debugging  and  Tools   •  Summary  
  • 6. Linux  Kernel   Android runs on Linux. Linux provides: Hardware abstraction layer Memory management Process management Networking Users never see Linux sub system The adb shell command opens Linux shell Linux Kernel Libraries Application Framework Applications Home Contacts Phone Browser Other Activity Manager Window Manager Content Providers View System Package Manager Telephony Manager Resource Manager Location Manager Notiication Manager Surface Manager OpenGL SGL Media Framework FreeType SSL SQLite WebKit libc Android Runtime Core Libs Delvik VM Display Driver Keypad Driver Camera Driver WiFi Driver Flash Driver Audio Driver Binder Driver Power Mgmt
  • 7. NaFve  Libraries   Pieces borrowed from other open source projects: Bionic, a super fast and small license-friendly libc library optimized for Android WebKit library for fast HTML rendering OpenGL for graphics Media codecs offer support for major audio/video codecs SQLite database Much more… Linux Kernel Libraries Application Framework Applications Home Contacts Phone Browser Other Activity Manager Window Manager Content Providers View System Package Manager Telephony Manager Resource Manager Location Manager Notiication Manager Surface Manager OpenGL SGL Media Framework FreeType SSL SQLite WebKit libc Android Runtime Core Libs Delvik VM Display Driver Keypad Driver Camera Driver WiFi Driver Flash Driver Audio Driver Binder Driver Power Mgmt
  • 8. Dalvik   Dalvik VM is Android implementation of Java VM Dalvik is optimized for mobile devices: • Battery consumption • CPU capabilities Key Dalvik differences: • Register-based versus stack-based VM • Dalvik runs .dex files • More efficient and compact implementation • Different set of Java libraries than JDK
  • 9. ApplicaFon  Framework   The rich set of system services wrapped in an intuitive Java API. This ecosystem that developers can easily tap into is what makes writing apps for Android easy. Location, web, telephony, WiFi, Bluetooth, notifications, media, camera, just to name a few. Linux Kernel Libraries Application Framework Applications Home Contacts Phone Browser Other Activity Manager Window Manager Content Providers View System Package Manager Telephony Manager Resource Manager Location Manager Notiication Manager Surface Manager OpenGL SGL Media Framework FreeType SSL SQLite WebKit libc Android Runtime Core Libs Delvik VM Display Driver Keypad Driver Camera Driver WiFi Driver Flash Driver Audio Driver Binder Driver Power Mgmt
  • 10. ApplicaFons   Dalvik Executable + Resources = APK Must be signed (but debug key is okay for development) Many markets with different policies
  • 11. Android  and  Java   Android Java = Java SE – AWT/Swing + Android API
  • 12. Android  SDK  -­‐  What’s  In  The  Box   SDK Tools Docs Platforms Data Skins Images Samples Add-ons Google
  • 14. Create  New  Project   Use the Eclipse tool to create a new Android project. Here are some key constructs: Project   Eclipse  construct   Target   minimum  to  run   App  name   whatever   Package   Java  package   AcFvity   Java  class  
  • 15. Anatomy   of  An  App   Java Code + XML and Other Resources + Manifest File = Android App
  • 16. The  Manifest  File   <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.marakana" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="5" /> </manifest>
  • 17. The  Layout  Resource   <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
  • 18. The  Java  File   package com.marakana; import android.app.Activity; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
  • 19. Running  on  Emulator   Emulator, not a simulator
  • 21. AcFviFes   Android Application Main Activity Another Activity Another Activity An Activity represents a screen or a window. Sort of.
  • 22. AcFvity  Lifecycle   Starting Running PausedStopped Destroyed (1) onSaveInstanceState() (2) onPause() (3) onResume() (2) onStart() (1) onRestart() onResume() (1) onSaveInstanceState() (2) onStop() <process killed> onDestroy() or <process killed> (1) onCreate() (2) onStart() (3) onRestoreInstanceState() (4) onResume() Activities have a well- defined lifecycle. The Android OS manages your activity by changing its state. You fill in the blanks.
  • 23. Intents   Android Application Another Activity Android Application Main Activity Intent Intent Main Activity Intent Another Activity Intents represent events or actions. They are to Android apps what hyperlinks are to websites. Sort of. Intents can be implicit or explicit.
  • 24. Services   Services are code that runs in the background. They can be started and stopped. Services doesn’t have UI.
  • 25. Service  Lifecycle   Service also has a lifecycle, but it’s much simpler than activity’s. An activity typically starts and stops a service to do some work for it in the background, such as play music, check for new tweets, etc. Services can be bound or unbound.
  • 26. Content  Providers   Content Provider Content URI insert() update() delete() query() Content Providers share content with applications across application boundaries. Examples of built-in Content Providers are: Contacts, MediaStore, Settings and more.
  • 27. Broadcast  Receivers   An Intent-based publish-subscribe mechanism. Great for listening system events such as SMS messages.
  • 28. Twitter.com MyTwitter Activity Updater Service Timeline Receiver Timeline DB Prefs XML Updates Status via web service Preference Activity Pull timeline updates via web service Insert updates in DB Notify of new status Timeline Activity Pull timeline from DB Update list Timeline Adapter Update ListView Read/write preferences Boot Receiver Start at boot Read Prefs Read Prefs Yamba  –  A  Real  World  App  
  • 30. Two  UI  Approaches   Procedural   DeclaraCve   You  write  Java  code   Similar  to  Swing  or  AWT   You  write  XML  code   Similar  to  HTML  of  a  web  page   You can mix and match both styles. Best practice: • Start with XML and declare most of UI • Switch to Java and implement the UI logic
  • 31. XML-­‐Based  User  Interface   Use WYSIWYG tools to build powerful XML-based UI. Easily customize it from Java. Separate concerns.
  • 32. Common  View  ProperFes   Layout  Width   FILL_PARENT,  WRAP_CONTENT or  a  specific  size  in  units.   Layout  Height   FILL_PARENT,  WRAP_CONTENT or  a  specific  size  in  units.   Layout  Weight   How  greedy  or  generous  a  widget  is.  Value  is  0  to  1.   Layout  Gravity   How  to  align  widget  within  parent   Gravity   How  to  align  content  of  widget  within  itself   Id   Unique  id  of  this  widget,  usually  @+id/someUniqueId! Text   Text  for  the  content  of  the  component,  usually  @string/myText!
  • 33. Dips  and  Sps   px  (pixel)   Dots  on  the  screen   in  (inches)   Size  as  measured  by  a  ruler   mm  (millimeters)   Size  as  measured  by  a  ruler   pt  (points)   1/72  of  an  inch   dp  (density-­‐independent  pixel)   Abstract  unit.  On  screen  with  160dpi,  1dp=1px   dip   synonym  for  dp  and  oeen  used  by  Google   sp   Similar  to  dp  but  also  scaled  by  users  font  size   preference  
  • 34. Views  and  Layouts   Layouts contain widgets and other layouts forming a “composite” pattern.
  • 35. Linear  Layout   One of the most commonly used layouts. It lays its children next to each other, either horizontally or vertically.
  • 36. RelaFve  Layout   Children of relative layout are placed in relationship to each other. This layout is efficient.
  • 37. Table  Layout   Table layout puts its children into table rows and columns. It is similar to an HTML table.
  • 38. Frame  Layout   Frame layout places its children on top of each other, like a deck of cards. It is useful for widgets such as tabs or as a placeholder for views added programmatically.
  • 39. Common  UI  Components   Android UI includes many common modern UI widgets, such as Buttons, Tabs, Progress Bars, Date and Time Pickers, etc.
  • 40. SelecFon  Components   Some UI widgets may be linked to zillion pieces of data. Examples are ListView and Spinners (pull-downs).
  • 41. Adapters   To make sure they run smoothly, Android uses Adapters to connect them to their data sources. A typical data source is an Array or a Database. Data Source Adapter
  • 42. Complex  Components   Certain high-level components are simply available just like Views. Adding a Map or a Video to your application is almost like adding a Button or a piece of text.
  • 44. Graphics  &  AnimaFon   Android has rich support for 2D graphics. You can draw & animate from XML. You can use OpenGL for 3D graphics.
  • 45. MulFmedia   AudioPlayer lets you simply specify the audio resource and play it. VideoView is a View that you can drop anywhere in your activity, point to a video file and play it. XML: <VideoView android:id="@+id/video" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center” /> Java: player = (VideoView) findViewById(R.id.video); player.setVideoPath("/sdcard/samplevideo.3gp"); player.start();
  • 47. Security   Android Application Prefs DB File System Linux Process Each Android application runs inside its own Linux process. Additionally, each application has its own sandbox file system with its own set of preferences and its own database. Other applications cannot access any of its data, unless it is explicitly shared.
  • 48. File  System   The file system has three main mount points. One for system, one for the apps, and one for whatever. Each app has its own sandbox easily accessible to it. No one else can access its data. The sandbox is in /data/data/com.marakana/ SDCard is expected to always be there. It’s a good place for large files, such as movies and music. Everyone can access it.
  • 49. Cloud  to  Device  Push   Big deal for many pull-based apps. Will make devices use less battery.
  • 50. Preferences   Your app can support complex preferences quite easily. You define your preferences in an XML file and the corresponding UI and data storage is done for free.
  • 51. SQLite  Database   Android ships with SQLite3 SQLite is a • Zero configuration • Serverless • Single database file • Cross-Platform • Compact • Public Domain Database engine. May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give.
  • 53. LogCat   The universal, most versatile way to track what is going on in your app. Can be viewed via command line or Eclipse. Logs can be generated both from SDK Java code, or low-level C code via Bionic libc extension.
  • 54. Debugger   Your standard debugger is included in SDK, with all the usual bells & whistles.
  • 55. TraceView   TraceView helps you profile you application and find bottlenecks. It shows execution of various calls through the entire stack. You can zoom into specific calls.
  • 56. Hierarchy  Viewer   Hierarchy Viewer helps you analyze your User Interface. Base UI tends to be the most “expensive” part of your application, this tool is very useful.
  • 57. Summary   Android is open and complete system for mobile development. It is based on Java and augmented with XML. Android is being adopted very quickly both by users, carriers, and manufacturers. It takes about 3-5 days of intensive training to learn Android application development for someone who has basic Java (or similar) experience. Licensed under Creative Commons License (cc-by-nc-nd) – non-commercial. Please Share! Marko Gargenta, Marakana.com marko@marakana.com +1-415-647-7000