Introduction to everything around Android:-
Android mobile operating system
Android app
Android app sandboxing
Android app development platform
Android emulators and advance techniques
Android device administration
Sample App
2. Agenda
Introduction to
o Android mobile operating system
o Android app
o Android app sandboxing
o Android app development platform
o Android emulators and advance techniques
o Android device administration
o Sample App
Bipin Jethwani
3. Android is a mobile operating
system (OS) based on the Linux
kernel and currently developed
by Google.
Bipin Jethwani
4. Initially developed by Android, Inc.,
which Google backed financially and
later bought in 2005, Android was
unveiled in 2007.
This was along with the founding of the Open Handset
Alliance— a consortium of hardware, software, and
telecommunication companies devoted to advancing open
standards for mobile devices.
Bipin Jethwani
5. The main hardware platform for Android is the
ARM architecture (ARMv7 and ARMv8-A architectures).
x86 and MIPS architectures are also officially supported
Since Android 5.0 "Lollipop", 64-bit variants of all
platforms are supported.
Bipin Jethwani
7. Google Nexus
Google's flagship Android
products
Google manages the design, development,
marketing, and support of these devices,
But some development and all manufacturing are
carried out by partnering original equipment
manufacturers (OEMs).
Nexus One
(by HTC)
Nexus S
(by Samsung)
Galaxy Nexus
(by Samsung)
Nexus 4
(by LG)
Nexus 5
(by LG)
Nexus 6
(by Motorola Mobility)
Nexus 7
(by Asus)
Nexus 9
(Google and HTC)
Nexus 10
(by Samsung)
Bipin Jethwani
21. Android 5.0 "Lollipop"
Android Runtime (ART) with ahead-of-time (AOT) compilation and
improved garbage collection (GC), replacing Dalvik that combines bytecode
interpretation with trace-based just-in-time (JIT) compilation.
Support for 64-bit CPUs
Material design
Project Volta, for battery life improvements
22. Android 5.1.1
Device protection: if a device is lost or stolen it will remain locked until the owner
signs into their Google account, even if the device is reset to factory settings.
24. However, they run on Android's own Java
Virtual Machine, called Dalvik Virtual
Machine (DVM)
25.
26. The Android SDK tools compile your code—
along with any data and resource files—into
an APK: an Android package, which is an
archive file with an .apk suffix.
27. .apk file is the containers for app binaries.
.dex files these are all the app’s .class files
converted to Dalvik byte code.
compiled resources (resources.arsc)
uncompiled resource
Binary version of AndroidManifest.xml
An .apk file contains all of the information necessary to run your application on a device or
emulator.
28.
29. App are made from components.
Android instantiates and runs them as needed.
30. The two fundamental concepts about Android app framework
App provide multiple entry points
o From one component you can start another component
using an intent. You can even start a component in a
different app, such as an activity in maps app to show an
address.
Apps adapt to different devices
o You can create different XML layout files for different
screen sizes and the system determines which layout to
apply based on the current device’s screen size.
31. Three of the four component types—activities,
services, and broadcast receivers—are
activated by an asynchronous message
called an intent.
35. Android OS is a multi-user Linux system
Each app is a different user.
36. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
37. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
This User ID doesn’t change during app’s life on a device.
38. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
This User ID doesn’t change during app’s life on a device.
This User ID is used only by the system and is unknown to the app.
39. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
This User ID doesn’t change during app’s life on a device.
This User ID is used only by the system and is unknown to the app.
System sets permissions for all the files in an app so that only the User ID assigned
to that app can access them.
40. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
This id doesn’t change during app’s life on a device.
This User ID is used only by the system and is unknown to the app.
System sets permissions for all the files in an app so that only the User ID assigned
to that app can access them.
Each process has its own virtual machine (VM), so an app's code runs in isolation
from other apps.
41. Android OS is a multi-user Linux system
Each app is a different user.
System assigns each app a unique Linux User ID
This id doesn’t change during app’s life on a device.
This User ID is used only by the system and is unknown to the app.
System sets permissions for all the files in an app so that only the User ID assigned
to that app can access them.
Each application is given a dedicated data directory which only it has permission
to read and write to
Each process has its own virtual machine (VM), so an app's code runs in isolation
from other apps.
By default, every app runs in its own Linux process. Android starts the process
when any of the app's components need to be executed, then shuts down the
process when it's no longer needed or when the system must recover memory for
other apps.
42.
43. Zygote is a daemon whose goal is to launch Apps.
44. Automatically generated UIDs for applications start at 10000 (AID_APP), and the
corresponding usernames are in the form
app_XXX or
uY_aXXX (on Android versions that support multiple physical users),
45. The data directory of the email application is named after its package name and is created
under /data/data/ on single-user devices.
46. Thus, applications are isolated, or sandboxed,
both at the process level (by having each run in a
dedicated process) and at the file level (by having a private
data directory).
This creates a kernel-level application sandbox, which
applies to all applications, regardless of whether they are
executed in a native or virtual machine process.
47. Apps that are signed with same certificate can share data, user ID, as well as run in
a single process. They just need to specify same sharedUserId and process.
53. Based on Eclipse
Based on IntelliJ Community Edition
Windows
•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
54. Based on Eclipse
Based on IntelliJ Community Edition
Windows
•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
Mac OS X
Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
55. Based on Eclipse
Based on IntelliJ Community Edition
Windows
•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
Mac OS X
Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
Linux
GNOME or KDE desktop
Tested on Ubuntu® 14.04, Trusty Tahr
56.
57.
58. DDMS
DDMS stands for: Dalvik Debug Monitor Server
It is used in:
Tracking memory allocation of objects
Examining thread information
Helps in emulating phone operations and location
Also for screen capture, call, and SMS spoofing.
59.
60.
61.
62. Google USB Driver
The Google USB Driver is required for Windows only in order to
perform adb debugging with any of the Google Nexus devices.
Downloading the Google USB Driver
63. Running android app on real devices via USB
To run the Android app on a real device (Android Phone or Android Tablet):
1.Connect the real device to your computer.
1.Make sure that you have the "USB Driver" for your device installed on your
computer.
2.Enable "USB Debugging" mode on your real device:
64. Running android app on real devices via USB
To run the Android app on a real device (Android Phone or Android Tablet):
1.Connect the real device to your computer.
1.Make sure that you have the "USB Driver" for your device installed on your
computer.
2.Enable "USB Debugging" mode on your real device:
(On Android 3.2 and older)
This allows Android SDK to transfer data between your computer and your device.
Also enable "Unknown source" from "Applications". This allows applications from
unknown sources to be installed on the device.
"Settings" ⇒ "Applications" ⇒ "Development" ⇒ Check "USB Debugging"
65. Running android app on real devices via USB
To run the Android app on a real device (Android Phone or Android Tablet):
1.Connect the real device to your computer.
1.Make sure that you have the "USB Driver" for your device installed on your
computer.
2.Enable "USB Debugging" mode on your real device:
(On Android 4.0 and newer)
"Settings" ⇒ "Developer options" ⇒ Check "USB Debugging".
66. Running android app on real devices using USB
To run the Android app on a real device (Android Phone or Android Tablet):
1.Connect the real device to your computer.
1.Make sure that you have the "USB Driver" for your device installed on your
computer.
2.Enable "USB Debugging" mode on your real device:
(On Android 4.2 and newer)
First you need to enable "Developer options" via
"Settings" ⇒ About Phone ⇒ tap "Build number" seven (7) times
"Settings" ⇒ "Developer options" ⇒ Check "USB Debugging".
70. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SYSTEM LIBRARIES
RUNTIME
APPLICATION FRAMEWORKS
SDK
KEY APPS
71. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SECURITY
MEMORY & PROCESS MANAGEMENT
FILE & NETWORK I/O
DEVICE DRIVERS
SYSTEM LIBRARIES
RUNTIME
APPLICATION FRAMEWORKS
SDK
KEY APPS
72. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SECURITY
MEMORY & PROCESS MANAGEMENT
FILE & NETWORK I/O
DEVICE DRIVERS
ANDROID SPECIFIC
POWER MANAGEMENT
SYSTEM LIBRARIES
APPLICATION FRAMEWORKS
KEY APPS
SDK
RUNTIME
73. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SECURITY
MEMORY & PROCESS MANAGEMENT
FILE & NETWORK I/O
DEVICE DRIVERS
ANDROID SPECIFIC
POWER MANAGEMENT
ANDROID SHARED MEMORY
SYSTEM LIBRARIES
APPLICATION FRAMEWORKS
KEY APPS
SDK
RUNTIME
74. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SECURITY
MEMORY & PROCESS MANAGEMENT
FILE & NETWORK I/O
DEVICE DRIVERS
ANDROID SPECIFIC
POWER MANAGEMENT
ANDROID SHARED MEMORY
LOW MEMORY KILLER
SYSTEM LIBRARIES
APPLICATION FRAMEWORKS
KEY APPS
SDK
RUNTIME
75. A SOFTWARE STACK FOR MOBILE DEVICES
ANDROID LINUX KERNEL
SECURITY
MEMORY & PROCESS MANAGEMENT
FILE & NETWORK I/O
DEVICE DRIVERS
ANDROID SPECIFIC
POWER MANAGEMENT
ANDROID SHARED MEMORY
LOW MEMORY KILLER
IPC - BINDER
SYSTEM LIBRARIES
APPLICATION FRAMEWORKS
KEY APPS
SDK
RUNTIME
76. A SOFTWARE STACK FOR MOBILE DEVICES
LINUX KERNEL
SYSTEM LIBRARIES
APPLICATION FRAMEWORKS
WINDOW MANAGER
VIEW SYSTEM
PACKAGE MANAGER
ACTIVITY MANAGER
LOCATION MANAGER
NOTIFICATION MANAGER
ALARM MANAGER
CONTENT PROVIDERS
RESOURCE MANAGER
TELEPHONY MANAGER
KEY APPS
SDK
RUNTIME
77.
78. Emulator
Can emulate many different device/user characteristics, such as
Network speed/latencies
Battery Power
Location coordinates
79. VGA means Video Graphics Array, and has a resolution of 640*480 pixels.
QVGA means Quarter Video Graphics Array and has a resolution of 320*240 pixels.
HVGA means Half Video Graphics Array, and has a resolution of 480*320 pixels.
WVGA (Wide Video Graphics Array) with a resolution of 800*480 pixels
FWVGA (Full Wide Video Graphics Array) at 854*480 pixels
The only difference between WVGA and FWVGA is the screen aspect ratio. WVGA has
15:9, and FWVGA is 16:9. 16:9 is better for HD movie watching
95. Android Device Manager
Android Device Manager is a Google app that allows you to
track and secure your devices remotely.
96. Android Device Manager
Android Device Manager is a Google app that allows you to
track and secure your devices remotely.
97. Android Device Manager
, you can remotely track your devices, cause them to ring (even if it
was put in silent mode), change the lock code, or completely wipe
your devices through this handy little app.
98. Android Device Manager
https://www.google.com/android/devicemanager
If you lose your android device, you can use Android Device
Manager to:
1. Find
2. Ring
3. Lock
4. Erase
5. Add a phone number to lock screen
Depending on the permissions you give Android Device
Manager in the Google Settings app
100. Android Device Manager
https://www.google.com/android/devicemanager
If you lose your android device, you can use Android Device
Manager to:
1. Find
2. Ring
3. Lock
4. Erase
5. Add a phone number to lock screen
Depending on the permissions you give Android Device
Manager in the Google Settings app