android part-1 - hello android
TRANSCRIPT
1Bipin Jethwani
Agenda
Introduction to
o Android mobile operating systemo Android appo Android app sandboxingo Android app development platformo Android emulators and advance techniqueso Android device administrationo Sample App
2
Android is a mobile operatingsystem (OS) based on the Linuxkernel and currently developedby Google.
3
Initially developed by Android, Inc.,which Google backed financially andlater bought in 2005, Android wasunveiled in 2007.
This was along with the founding of the Open HandsetAlliance—aconsortiumof hardware, software, andtelecommunication companies devoted to advancing openstandards for mobile devices.
4
The main hardware platform for Android is theARM architecture (ARMv7 and ARMv8-A architectures).
x86 and MIPS architectures are also officially supported
Since Android 5.0 "Lollipop", 64-bit variants of allplatforms are supported.
5
Initial release September 23, 2008Latest release April 21, 2015 (5.1.1 "Lollipop“)
6
Android 1.5 Cupcake
7
Android 1.6 Donut
8
Android 2.0 Éclair Expanded Account sync, allowing users to add multiple accounts (emails and contacts) Microsoft Exchange email support. Bluetooth 2.1 support Multi-touch events
9
Android 2.2 Froyo (Frozen Yoghurt) Push Notifications Adobe Flash support. Chrome's V8 JavaScript engine into the Browser Microsoft Exchange security enhancements including remote wipe Installing apps on SD card
10
Android 2.3 Gingerbread Native Code Development Near Field Communication (NFC) Download Manager Power Management
11
Android 3.0 Honeycomb The first tablet-only Android update. Multi-core Processors
12
Android 4.0 Ice Cream Sandwich Face Unlock
13
Android 4.1 (Jelly Bean)(API level 16)
Android 4.1 Jelly Bean(API level 16)
14
Android 4.2 Jelly Bean(API level 17)
15
Android 4.4 KitKat(API level 19)
16
Android 5.0 "Lollipop" Android Runtime (ART) with ahead-of-time (AOT) compilation andimproved garbage collection (GC), replacing Dalvik that combines bytecodeinterpretation with trace-based just-in-time (JIT) compilation. Support for 64-bit CPUs Material design Project Volta, for battery life improvements
17
Android 5.1.1 Device protection: if a device is lost or stolen it will remain locked until the ownersigns into their Google account, even if the device is reset to factory settings.
18
Android apps are written in the Javaprogramming language
19
However, they run on Android's own JavaVirtual Machine, called Dalvik VirtualMachine (DVM)
20
21
The Android SDK tools compile your code—along with any data and resource files—intoan APK: an Android package, which is anarchive file with an .apk suffix.
22
.apk file is the containers for app binaries.
.dex files these are all the app’s .class filesconverted 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 oremulator.
23
24
App are made from components.Android instantiates and runs them as needed.
25
The two fundamental concepts about Android app framework App provide multiple entry points
o From one component you can start another componentusing an intent. You can even start a component in adifferent app, such as an activity in maps app to show anaddress. Apps adapt to different devices
o You can create different XML layout files for differentscreen sizes and the system determines which layout toapply based on the current device’s screen size.
26
Application Sandboxing
27
Once installed on a device, each Android app lives in its own security sandbox
28
Android OS is a multi-user Linux system
29
Android OS is a multi-user Linux system Each app is a different user.
30
Android OS is a multi-user Linux system Each app is a different user. System assigns each app a unique Linux User ID
31
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.
32
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.
33
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.
34
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.
35
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 theprocess when it's no longer needed or when the system must recover memory forother apps.
36
37
Zygote is a daemon whose goal is to launch Apps.
38
Automatically generated UIDs for applications start at 10000 (AID_APP), and thecorresponding usernames are in the form app_XXX or uY_aXXX (on Android versions that support multiple physical users),
39
The data directory of the email application is named after its package name and is createdunder /data/data/ on single-user devices.
40
Thus, applications are isolated, or sandboxed,both at the process level (by having each run in adedicated process) and at the file level (by having a privatedata directory).
This creates a kernel-level application sandbox, whichapplies to all applications, regardless of whether they areexecuted in a native or virtual machine process.
41
Apps that are signed with same certificate can share data, user ID, as well as run ina single process. They just need to specify same sharedUserId and process.
42
43
44
45
Android Development Environment
Your workbench for writing android applications
46
Based on Eclipse
Based on IntelliJ Community Edition47
Based on Eclipse
Based on IntelliJ Community Edition
Windows•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
48
Based on Eclipse
Based on IntelliJ Community Edition
Windows•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)Mac OS XMac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
49
Based on Eclipse
Based on IntelliJ Community Edition
Windows•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)Mac OS XMac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)LinuxGNOME or KDE desktopTested on Ubuntu® 14.04, Trusty Tahr
50
A SOFTWARE STACK FOR MOBILE DEVICES
51
A SOFTWARE STACK FOR MOBILE DEVICES ANDROID LINUX KERNEL SYSTEM LIBRARIES RUNTIME APPLICATION FRAMEWORKS SDK KEY APPS
52
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
53
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
54
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
55
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
56
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
57
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
58
59
Emulator
Can emulate many different device/user characteristics, such asNetwork speed/latenciesBattery PowerLocation coordinates
60
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 pixelsFWVGA (Full Wide Video Graphics Array) at 854*480 pixels
The only difference between WVGA and FWVGA is the screen aspect ratio. WVGA has15:9, and FWVGA is 16:9. 16:9 is better for HD movie watching
61
telnet localhost 554
62
help
63
power capacity 100
64
power ac offpower status not-charging
65
power capacity 5
66
power ac offhelp networkhelp network speed
67
network speed edge
68
network speed edgeEDGE (Enhanced GPRS) on GSM networks. It give 3x speed than outdated GPRS system. Max of 473 kbps.
69
network speed full
70
71
72
73
74
75