instructor: mazhar hussain · instructor: mazhar hussain. previous lecture ... v. 2.0)...
TRANSCRIPT
![Page 1: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/1.jpg)
PROGRAMMING WITH ANDROID:
SYSTEM ARCHITECTURE
&
MOBILE IP
Instructor: Mazhar Hussain
![Page 2: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/2.jpg)
PREVIOUS LECTURE
•Desktop and Service side Programming
•Software design concerns
2
![Page 3: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/3.jpg)
3
OUTLINE
Android Components: Content Providers
Android Components: Services
Android Components: Intents
Android Components: Activities
Android Dalvik Java Virtual Machine
Android Architecture: An Overview
Android Application Distribution and Markets
![Page 4: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/4.jpg)
4
ANDROID … WHAT?Android is a Linux-based
platform for mobile devices …
Operating System
Middleware
Applications
Software Development Kit (SDK)
Which kind of mobile devices … (examples)
SMARTPHONES TABLETS EREADERS ANDROID TV GOOGLE GLASSES
?
![Page 5: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/5.jpg)
5
ANDROID … WHEN?
Google buys Android from the Android
Inch
Open Handset Alliance (OHA) created for
open standards for mobile devices. Partners of
OHA: Google, Motorola, Samsung, Vodafone, T-
Mobile, etc
Android 1.0 Released
The first Android smartphone: G1 HTC-Dream
Android 1.1 Released
Android 1.5 (CupCake) Released
2005
2006
2007
2008
2009
Time
![Page 6: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/6.jpg)
6
ANDROID … WHEN? Android 1.6 (Donut) Released
Android 2.0 (Eclair) Released
Android 2.2 (Froyo) Released
Android 2.3 (Gingerbread) Released
Android 3.0 (Honeycomb) Released
(First version for devices with larger screens such as tablets)
Android 4.0 (Ice-Cream Sandwich)
Released. (It merges the 3.x tab centric design and the
v2.x phone based design into a single version.)
2008
2009
2010
2011
2012
Time
![Page 7: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/7.jpg)
7
ANDROID … WHEN? Android 4.2 (Jelly Bean) Released
Gesture Mode for Accessibility
Improved browser performance
Easy data-sharing through NFC
Improved camera and face recognition
functionalities
…
API Level 17 (Android 4.2):
Daydream: screensaver customization API
Support to multi-user environments
Nested fragments for UI improvements
…
2012
2013
Time
KEY LIME PIE
![Page 8: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/8.jpg)
8
ANDROID … WHEN?
http://developer.android.com/about/dashboards/index.html http://www.appbrain.com/stats/android-market-
app-categories
ANDROID DISTRIBUTIONS ANDROID APPLICATIONS
x
![Page 9: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/9.jpg)
9
ANDROID … WHEN?
ANDROID VERSION
HISTORY AND POPULARITY
(2009-2013)
http://en.wikipedia.org/wiki/Android_version_history
2.3.x
2.2.x1.6-2.0
4.x
![Page 10: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/10.jpg)
10
THE ANDROID ARCHITECTURE
} Stack
Architect
ure
Open Source
Architecture
(Apache/MIT License
v. 2.0)
Business-friendly
License
![Page 11: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/11.jpg)
11
THE ANDROID ARCHITECTURE
Built on top of
Linux kernel
(v. 2.6-3.0)
Advantages:
Portability (i.e.
easy to compile on
different harwdare
architectures)
Security (e.g.
secure multi-process
environment)
Power
Management
![Page 12: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/12.jpg)
12
THE ANDROID ARCHITECTURE Native
Libraries (C/C++ code)
Graphics (Surface
Manager)
Multimedia (Media
Framework)
Database DBMS (SQLite)
Font
Management (FreeType)
WebKit
C libraries (Bionic)
….
![Page 13: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/13.jpg)
13
THE ANDROID ARCHITECTUREApplication
Libraries(Core Components of
Android)
Activity
Manager
Packet Manager
Telephony
Manager
Location
Manager
Contents
Provider
Notification
Manager
….
![Page 14: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/14.jpg)
14
THE ANDROID ARCHITECTURE
Applications(Written in Java code)
Android Play
Store
Entertainment
Productivity
Personalization
Education
Geo-
communication
….
![Page 15: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/15.jpg)
15
THE ANDROID ARCHITECTURE
Dalvik
Virtual
Machine (VM)
Novel Java
Virtual Machine
implementation (not
using the Oracle
JVM)
Open License
(Oracle JVM is not
open!)
Optimized for
memory-constrained
devices
Faster than
![Page 16: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/16.jpg)
16
DALVIK JAVA VIRTUAL MACHINE (JVM)Java
Source
Code
Java Byte
Code
Java
Virtual
Machine
(JVM)
Java
Source
Code
Java Byte
Code
Dalvik
Byte
Code
Dalvik
Virtual
Machine
(VM)
Java
Compiler
Java
Compiler
Dex
CompilerStack-based
byte-code
Register-based
byte-code
Java Standard Edition
![Page 17: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/17.jpg)
17
ANDROID APPLICATIONS DESIGN
GUI Definition
Events Management
Application Data
Management
Background Operations
User Notifications
APPLICATION DESIGN:
![Page 18: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/18.jpg)
18
ANDROID APPLICATIONS DESIGN
Activities
Intents
Services
Content Providers
Broadcast Receivers
APPLICATION COMPONENTS
![Page 19: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/19.jpg)
19
ANDROID COMPONENTS: ACTIVITIES
An Activity corresponds to a
single screen of the
Application.
An Application can be composed of
multiples screens (Activities).
The Home Activity is shown
when the user launches an
application.
Different activities can exhange
information one with each other.
Hello World!
Android
HelloWorld
Button1
![Page 20: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/20.jpg)
20
ANDROID COMPONENTS: ACTIVITIES
Each activity is composed by a list of graphics
components.
Some of these components (also called Views)
can interact with the user by handling events
(e.g. Buttons).
Two ways to build the graphic interface:
Example:
Button button=new Button (this);TextView text= new TextView();text.setText(“Hello world”);
PROGRAMMATIC APPROACH
![Page 21: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/21.jpg)
21
ANDROID COMPONENTS: ACTIVITIES
Each activity is composed by a list of graphics
components.
Some of these components (also called Views)
can interact with the user by handling events
(e.g. Buttons).
Two ways to build the graphic interface:
Example:
< TextView android.text=@string/hello”android:textcolor=@color/blue android:layout_width=“fill_parent”android:layout_height=“wrap_content” />< Button android.id=“@+id/Button01”android:textcolor=“@color/blue”android:layout_width=“fill_parent”android:layout_height=“wrap_content” />
DECLARATIVE APPROACH
![Page 22: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/22.jpg)
22
- Build the application
layout through XML files(like HTML)
- Define two different XML
layouts for two different
devices
- At runtime, Android
detects the current device
configuration and loads
the appropriate resources
for the application
- No need to recompile!
- Just add a new XML file
if you need to support a
EXAMPLE
Device 1HIGH screen pixel density
Device 2LOW screen pixel density
XML Layout FileDevice 1
XML Layout FileDevice 2
Java App Code
ANDROID COMPONENTS: ACTIVITIES
![Page 23: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/23.jpg)
23
ANDROID COMPONENTS: ACTIVITIES
Android applications typically use both the
approaches!DECLARATIVE
APPROACH
PROGRAMMATIC APPROACH
Define the Application
layouts and resources
used by the Application
(e.g. labels).
Manages the events, and
handles the interaction
with the user.
XML Code
Java Code
![Page 24: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/24.jpg)
24
ANDROID COMPONENTS: ACTIVITIES
Views can generate events (caused by
human interactions) that must be managed by
the Android-developer.
public void onClick(View arg0) {if (arg0 == Button) {
// Manage Button events}
}
ESEMPIO
Bu
tton
TextE
dit
![Page 25: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/25.jpg)
25
ANDROID COMPONENTS: ACTIVITIES
The Activity Manager is
responsible for creating,
destroying, managing activities.
Activities can be on different
states: starting, running,
stopped, destroyed, paused.
Only one activity can be on the
running state at a time.
Activities are organized on a
stack, and have an event-
driven life cycle (details later …)
![Page 26: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/26.jpg)
26
ANDROID COMPONENTS: ACTIVITIES
Main difference between Android-programming and
Java (Oracle) -programming:
Mobile devices have constrained resource
capabilities!
Activity lifetime depends on users’ choice (i.e.
change of visibility) as well as on system
contraints (i.e. memory shortage).
Developer must implement lifecycle methods to
account for state changes of each Activity …
![Page 27: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/27.jpg)
27
ANDROID COMPONENTS: ACTIVITIES
public class MyApp extends Activity {
public void onCreate() { ... }
public void onPause() { ... }
public void onStop() { ... }
public void onDestroy(){ ... }
….
}
Called when the Activity
is created the first time.
Called when the Activity
is partially visible.
Called when the Activity
is no longer visible.
Called when the Activity
is dismissed.
![Page 28: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/28.jpg)
28
ANDROID COMPONENTS: INTENTS Intents: asynchronous messages to activate
core Android components (e.g. Activities).
Explicit Intent The component (e.g.
Activity1) specifies the destination of the intent
(e.g. Activity 2).
LOGIN
PASSWO
RD
Logi
n
marco
**********
Welcome Marco!
Login Intent
Activity1
Activity2
![Page 29: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/29.jpg)
29
ANDROID COMPONENTS: INTENTS Intents: asynchronous messages to activate
core Android components (e.g. Activities).
Implicit Intent The component (e.g.
Activity1) specifies the type of the intent (e.g.
“View a video”).
View
Implicit Intent
Activity1
Activity2
Activity2
Multiple choices
might be available
to the user! } Intent-
Filters
![Page 30: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/30.jpg)
30
ANDROID COMPONENTS: SERVICES Services: like Activities, but run in
background and do not provide an user
interface.
Used for non-interactive tasks (e.g.
networking).
Service life-time composed of 3 states:Startin
g
Destroy
ed
Runnin
g
(on background)
onCreate()
onStart()onDestroy()
![Page 31: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/31.jpg)
31
ANDROID COMPONENTS: CONTENT PROVIDERS
Each Android application has its own
private set of data (managed through files or
through SQLite database).
Content Providers: Standard interface
to access and share data among different
applications.
DB
APP
insert
()update()
delete
()query
()
Conte
nt
Provid
er e.g. Photo
Gallery
![Page 32: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/32.jpg)
32
ANDROID COMPONENTS: BROADCAST RECEIVERS
Publish/Subscrib
e paradigm
Broadcast
Receivers: An
application can
be signaled of
external
events.
Notification
types: Call
incoming, SMS
delivery, Wifi
![Page 33: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/33.jpg)
33
ANDROID COMPONENTS: BROADCAST RECEIVERS
class WifiReceiver extends BroadcastReceiver {
public void onReceive(Context c, Intent intent) {
String s = new StringBuilder();
wifiList = mainWifi.getScanResults();
for(int i = 0; i < wifiList.size(); i++){
s.append(new Integer(i+1).toString() + ".");
s.append((wifiList.get(i)).toString());
s.append("\\n");
}
mainText.setText(sb);
}
BROADCAST RECEIVER example
![Page 34: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/34.jpg)
34
ANDROID COMPONENTS: BROADCAST RECEIVERS
public class WifiTester extends Activity {
WifiManager mainWifi;
WifiReceiver receiverWifi;
List<ScanResult> wifiList;
public void onCreate(Bundle savedInstanceState)
{
…
mainWifi = (WifiManager)
getSystemService(Context.WIFI_SERVICE);
receiverWifi = new WifiReceiver();
registerReceiver(receiverWifi, new
IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE
_ACTION));
mainWifi.startScan();
}
BROADCAST RECEIVER example
![Page 35: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/35.jpg)
35
ANDROID COMPONENTS: SYSTEM API
Using the components described so far, Android
applications can then leverage the system API …
Telephony Manager data access (call, SMS, etc)
Sensor management (GPS, accelerometer, etc)
Network connectivity (Wifi, bluetooth, NFC, etc)
Web surfing (HTTP client, WebView, etc)
Storage management (files, SQLite db, etc)
….
SOME EXAMPLEs …
![Page 36: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/36.jpg)
36
ANDROID COMPONENTS: GOOGLE API
… or easily interface with other Google
services:
![Page 37: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/37.jpg)
37
Each Android application is
contained on a single APK file.
Java Byte-code (compiled for
Dalvik JVM)
Resources (e.g. images. videos,
XML layout files)
Libraries (optimal native C/C++
code)
APK
FIL
E
XM
L
File
s
C
Android Application Distribution
![Page 38: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/38.jpg)
38
ANDROID APPLICATION DISTRIBUTION
Each application must be
signed through a key
before being distributed.
Applications can be
distributed via Web or
via Stores.
Android Play Store:
application store run by
Google … but several
other application stores
are available (they are
just normal applications).
![Page 39: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/39.jpg)
39
ANDROID APPLICATION SECURITY
Android applications run with a distinct
system identity (Linux user ID and group
ID), in an isolated way.
Applications must explicitly share
resources and data. They do this by
declaring the permissions they need for
additional capabilities.
Applications statically declare the permissions
they require.
User must give his/her consensus during the
installation.
<uses-permission android:name=“android.permission.IACCESS_FINE_LOCATION" />
<uses-permission android:name=“android.permission.INTERNET" />
ANDROIDMANIFEST.XML
![Page 40: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/40.jpg)
MOBILE NETWORKING THROUGHMOBILE IP
![Page 41: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/41.jpg)
TRULY MOBILE NETWORKING
Provide confident access to the Internet
anytime, anywhere
Reconnection occurs automatically and
noninteractively
Mobility transparent to applications and
higher level protocols such as TCP
![Page 42: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/42.jpg)
TODAY’S INTERNET PROTOCOL
Packets are routed to destinations based on
IP address
![Page 43: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/43.jpg)
APPLY TO MOBILE NETWORKING
![Page 44: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/44.jpg)
APPLY TO MOBILE NETWORKING
128.143.77.84
X
![Page 45: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/45.jpg)
MOBILE IP APPROACH
Mobile IP uses two IP addresses:
Home address: The IP address assigned to the
mobile node, making it logically appear attached to its
home network.
Care-of address: An IP address at the mobile node's
current point of attachment to the Internet, when the
mobile node is not attached to the home network.
![Page 46: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/46.jpg)
MOBILE NETWORK TERMINOLOGY (1)
Home network: The network at which the mobile node
seems reachable, to the rest of the Internet, by virtue of its
assigned IP address.
Foreign network: The network to which the mobile
node is attached when it is not attached to its home
network, and on which the care-of address is reachable
from the rest of the Internet.
![Page 47: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/47.jpg)
MOBILE NETWORK TERMINOLOGY (2)
Home agent: A router on the home network that
effectively causes the mobile node to be reachable at its
home address even when the mobile node is not attached
to its home network.
Foreign agent: A router on the foreign network that can
assist the mobile node in receiving datagrams delivered to
the care-of address.
![Page 48: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/48.jpg)
HOW MOBILE IP WORKS
128.143.77.84
HA
![Page 49: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/49.jpg)
HOW MOBILE IP WORKS
128.143.77.84
HA
FA
Register
Discovery
Discovering the care-of address
Registering the care-of address
Tunneling to the care-of address
![Page 50: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/50.jpg)
AGENT DISCOVERY PROTOCOL
Extends ICMP Router Discovery protocol
ICMP Router Discovery Protocol enables hosts attached
to multicast or broadcast networks to discover the IP
addresses of their neighboring routers.
Agent advertisements: The mobile agent broadcast
agent advertisements at regular intervals.
Agent solicitation: The mobile node broadcast or
multicast a solicitation that will be answered by any
foreign agent or home agent that receives it.
![Page 51: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/51.jpg)
ADVERTISEMENT MESSAGE FORMATS
ICMP Router Advertisement Agent Advertisement extension
Type: 16
R: register required
B: busy
H: home agent
F: foreign agent
M: minimum encapsulation
G: GRE encapsulation
V: Van Jacobson header compression
![Page 52: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/52.jpg)
ADVERTISEMENT MESSAGE FORMATS
ICMP Router Advertisement Prefix Length extension
Type: 19
Prefix Length:network number of the corresponding Router Address listed in the ICMP Router Advertisement portion of the message.
![Page 53: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/53.jpg)
MOBILE NODE MOVE DETECTIONLifetime based
The mobile node record the Lifetime of advertisement message. If it fails to receive another advertisement from the same agent until the the Lifetime expires, it considers to find a new agent.
Network prefixes based
The Prefix-length extension is used to determine if the newly received advertisement is in the same subnet as the mobile node’s current care-of-
address.
![Page 54: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/54.jpg)
REGISTRATION
MH: mobile host; FA: Foreign Agent; HA: Home Address
Exchange of Registration Request and Registration
Reply messages: UDP using well-known port 434
![Page 55: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/55.jpg)
FOREIGN AGENT CONSIDERATION Each foreign agent must be configured with a care
of address
For each pending or current registration, the foreign
agent maintains a visitor list entry containing:
Link-layer source address of the mobile node
The mobile node’s Home Address
The Home Agent address
The identification field
The requested registration Lifetime
The remaining Lifetime of the pending or current
registration
![Page 56: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/56.jpg)
SECURITY CONSIDERATIONS IN REGISTRATION
Danger: Registration Request works remotely to the
home agent to affect the home agent's routing table
Security:
Authentication: Home agents and mobile nodes perform
authentication using MD5 algorithm and key size of 128
bits.
Replay Protection: The Identification field is used to verify
that a registration message has been freshly generated.
timestamp , random number
![Page 57: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/57.jpg)
TUNNELING TO THE CARE OF ADDRESS
![Page 58: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/58.jpg)
CHANGES WITH IP VERSION 6
Route Optimization
When it knows the mobile node's current care-of
address, a correspondent node can deliver packets
directly to the mobile node's home address without
any assistance from the home agent
Security
Strong authentication and encryption features are
included in IP V6
![Page 59: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/59.jpg)
PROBLEMS FACING MOBILE IP
Security issues
Routing inefficiency
Triangle routing
Ingress filtering
User perceptions of reliability
Competition from other protocols
![Page 60: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/60.jpg)
REFERENCE
"Mobile Networking through Mobile IP," C.
Perkins, IEEE Internet Computing, Vol. 2, No. 1,
1998.
"Mobile IP ," C. Perkins, IEEE Communications
Magazine, Vol. 35, No. 5, 1997.
![Page 61: Instructor: Mazhar Hussain · Instructor: Mazhar Hussain. PREVIOUS LECTURE ... v. 2.0) Business-friendly License. 11 THE ANDROID ARCHITECTURE Built on top of Linux kernel (v. 2.6-3.0)](https://reader034.vdocument.in/reader034/viewer/2022052017/602f6b8fece8806cc6212776/html5/thumbnails/61.jpg)
QUESTIONS/COMMENTS?
61