Top Banner
Bipin Jethwani
112
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to everything around Android

Bipin Jethwani

Page 2: Introduction to everything around Android

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

Bipin Jethwani

Page 3: Introduction to everything around Android

Android is a mobile operatingsystem (OS) based on the Linuxkernel and currently developedby Google.

Bipin Jethwani

Page 4: Introduction to everything around Android

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.

Bipin Jethwani

Page 5: Introduction to everything around Android

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.

Bipin Jethwani

Page 6: Introduction to everything around Android

Bipin Jethwani

Page 7: Introduction to everything around Android

Google Nexus Google's flagship AndroidproductsGoogle manages the design, development,marketing, and support of these devices, But some development and all manufacturing arecarried out by partnering original equipmentmanufacturers (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

Page 8: Introduction to everything around Android

Initial release September 23, 2008Latest release April 21, 2015 (5.1.1 "Lollipop“)

Bipin Jethwani

Page 9: Introduction to everything around Android

Bipin Jethwani

Page 10: Introduction to everything around Android

Android 1.5 Cupcake

Bipin Jethwani

Page 11: Introduction to everything around Android

Android 1.6 Donut

Page 12: Introduction to everything around Android

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

Page 13: Introduction to everything around Android

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

Page 14: Introduction to everything around Android

Android 2.3 Gingerbread Native Code Development Near Field Communication (NFC) Download Manager Power Management

Page 15: Introduction to everything around Android

Android 3.0 Honeycomb The first tablet-only Android update. Fragment class was introduced Multi-core Processors

Page 16: Introduction to everything around Android

Android 3.0 Honeycomb The first tablet-only Android update. Fragment class was introduced Multi-core Processors

Page 17: Introduction to everything around Android

Android 4.0 Ice Cream Sandwich Face Unlock

Page 18: Introduction to everything around Android

Android 4.1 (Jelly Bean)(API level 16)

Android 4.1 Jelly Bean(API level 16)

Page 19: Introduction to everything around Android

Android 4.2 Jelly Bean(API level 17)

Page 20: Introduction to everything around Android

Android 4.4 KitKat(API level 19)

Page 21: Introduction to everything around Android

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

Page 22: Introduction to everything around Android

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.

Page 23: Introduction to everything around Android

Android apps are written in the Javaprogramming language

Page 24: Introduction to everything around Android

However, they run on Android's own JavaVirtual Machine, called Dalvik VirtualMachine (DVM)

Page 25: Introduction to everything around Android
Page 26: Introduction to everything around Android

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.

Page 27: Introduction to everything around Android

.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.

Page 28: Introduction to everything around Android
Page 29: Introduction to everything around Android

App are made from components.Android instantiates and runs them as needed.

Page 30: Introduction to everything around Android

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.

Page 31: Introduction to everything around Android

Three of the four component types—activities,services, and broadcast receivers—areactivated by an asynchronous messagecalled an intent.

Page 32: Introduction to everything around Android

Application Sandboxing

Page 33: Introduction to everything around Android

Once installed on a device, each Android app lives in its own security sandbox

Page 34: Introduction to everything around Android

Android OS is a multi-user Linux system

Page 35: Introduction to everything around Android

Android OS is a multi-user Linux system Each app is a different user.

Page 36: Introduction to everything around Android

Android OS is a multi-user Linux system Each app is a different user. System assigns each app a unique Linux User ID

Page 37: Introduction to everything around Android

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.

Page 38: Introduction to everything around Android

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.

Page 39: Introduction to everything around Android

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.

Page 40: Introduction to everything around Android

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.

Page 41: Introduction to everything around Android

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.

Page 42: Introduction to everything around Android
Page 43: Introduction to everything around Android

Zygote is a daemon whose goal is to launch Apps.

Page 44: Introduction to everything around Android

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),

Page 45: Introduction to everything around Android

The data directory of the email application is named after its package name and is createdunder /data/data/ on single-user devices.

Page 46: Introduction to everything around Android

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.

Page 47: Introduction to everything around Android

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.

Page 48: Introduction to everything around Android
Page 49: Introduction to everything around Android
Page 50: Introduction to everything around Android
Page 51: Introduction to everything around Android

Android Development Environment

Your workbench for writing android applications

Page 52: Introduction to everything around Android

Based on Eclipse

Based on IntelliJ Community Edition

Page 53: Introduction to everything around Android

Based on Eclipse

Based on IntelliJ Community Edition

Windows•Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)

Page 54: Introduction to everything around Android

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)

Page 55: Introduction to everything around Android

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

Page 56: Introduction to everything around Android
Page 57: Introduction to everything around Android
Page 58: Introduction to everything around Android

DDMSDDMS stands for: Dalvik Debug Monitor ServerIt is used in:

Tracking memory allocation of objectsExamining thread informationHelps in emulating phone operations and locationAlso for screen capture, call, and SMS spoofing.

Page 59: Introduction to everything around Android
Page 60: Introduction to everything around Android
Page 61: Introduction to everything around Android
Page 62: Introduction to everything around Android

Google USB DriverThe Google USB Driver is required for Windows only in order toperform adb debugging with any of the Google Nexus devices.Downloading the Google USB Driver

Page 63: Introduction to everything around Android

Running android app on real devices via USBTo 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 yourcomputer.2.Enable "USB Debugging" mode on your real device:

Page 64: Introduction to everything around Android

Running android app on real devices via USBTo 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 yourcomputer.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 fromunknown sources to be installed on the device.

"Settings"⇒ "Applications"⇒ "Development"⇒ Check "USB Debugging"

Page 65: Introduction to everything around Android

Running android app on real devices via USBTo 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 yourcomputer.2.Enable "USB Debugging" mode on your real device:(On Android 4.0 and newer)

"Settings"⇒ "Developer options"⇒ Check "USB Debugging".

Page 66: Introduction to everything around Android

Running android app on real devices using USBTo 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 yourcomputer.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".

Page 67: Introduction to everything around Android
Page 68: Introduction to everything around Android
Page 69: Introduction to everything around Android

A SOFTWARE STACK FOR MOBILE DEVICES

Page 70: Introduction to everything around Android

A SOFTWARE STACK FOR MOBILE DEVICES ANDROID LINUX KERNEL SYSTEM LIBRARIES RUNTIME APPLICATION FRAMEWORKS SDK KEY APPS

Page 71: Introduction to everything around Android

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

Page 72: Introduction to everything around Android

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

Page 73: Introduction to everything around Android

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

Page 74: Introduction to everything around Android

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

Page 75: Introduction to everything around Android

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

Page 76: Introduction to everything around Android

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

Page 77: Introduction to everything around Android
Page 78: Introduction to everything around Android

Emulator

Can emulate many different device/user characteristics, such asNetwork speed/latenciesBattery PowerLocation coordinates

Page 79: Introduction to everything around Android

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

Page 80: Introduction to everything around Android

telnet localhost 554

Page 81: Introduction to everything around Android

help

Page 82: Introduction to everything around Android

power capacity 100

Page 83: Introduction to everything around Android

power ac offpower status not-charging

Page 84: Introduction to everything around Android

power capacity 5

Page 85: Introduction to everything around Android

power ac offhelp networkhelp network speed

Page 86: Introduction to everything around Android

network speed edge

Page 87: Introduction to everything around Android

network speed edgeEDGE (Enhanced GPRS) on GSM networks. It give 3x speed than outdated GPRS system. Max of 473 kbps.

Page 88: Introduction to everything around Android

network speed full

Page 89: Introduction to everything around Android
Page 90: Introduction to everything around Android
Page 91: Introduction to everything around Android
Page 92: Introduction to everything around Android
Page 93: Introduction to everything around Android
Page 94: Introduction to everything around Android

Android Device Manager

Page 95: Introduction to everything around Android

Android Device Manager

Android Device Manager is a Google app that allows you totrack and secure your devices remotely.

Page 96: Introduction to everything around Android

Android Device Manager

Android Device Manager is a Google app that allows you totrack and secure your devices remotely.

Page 97: Introduction to everything around Android

Android Device Manager

, you can remotely track your devices, cause them to ring (even if itwas put in silent mode), change the lock code, or completely wipeyour devices through this handy little app.

Page 98: Introduction to everything around Android

Android Device Managerhttps://www.google.com/android/devicemanagerIf you lose your android device, you can use Android DeviceManager to:

1. Find2. Ring3. Lock4. Erase5. Add a phone number to lock screen

Depending on the permissions you give Android DeviceManager in the Google Settings app

Page 99: Introduction to everything around Android

Android Device Managerhttps://www.google.com/android/devicemanagerIf you lose your android device, you can use Android DeviceManager to:

1. Locate2. Ring3. Lock4. Erase5. Add a phone number to lock screen

Page 100: Introduction to everything around Android

Android Device Managerhttps://www.google.com/android/devicemanagerIf you lose your android device, you can use Android DeviceManager to:

1. Find2. Ring3. Lock4. Erase5. Add a phone number to lock screen

Depending on the permissions you give Android DeviceManager in the Google Settings app

Page 101: Introduction to everything around Android

www.google.co.inwww.android.com/devicemanagerwww.google.com/android/devicemanager

Page 102: Introduction to everything around Android
Page 103: Introduction to everything around Android
Page 104: Introduction to everything around Android
Page 105: Introduction to everything around Android
Page 106: Introduction to everything around Android
Page 107: Introduction to everything around Android
Page 108: Introduction to everything around Android
Page 109: Introduction to everything around Android
Page 110: Introduction to everything around Android
Page 111: Introduction to everything around Android
Page 112: Introduction to everything around Android

~ End of part-1 ~