introduction to everything around android

112
Bipin Jethwani

Upload: bipin-jethwani

Post on 25-Jul-2015

43 views

Category:

Software


0 download

TRANSCRIPT

Bipin 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

Bipin Jethwani

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

Bipin Jethwani

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

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

Bipin Jethwani

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

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

Bipin Jethwani

Bipin Jethwani

Android 1.5 Cupcake

Bipin Jethwani

Android 1.6 Donut

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

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

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

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

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

Android 4.0 Ice Cream Sandwich Face Unlock

Android 4.1 (Jelly Bean)(API level 16)

Android 4.1 Jelly Bean(API level 16)

Android 4.2 Jelly Bean(API level 17)

Android 4.4 KitKat(API level 19)

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

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.

Android apps are written in the Javaprogramming language

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

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.

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

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

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.

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

Application Sandboxing

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

Android OS is a multi-user Linux system

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

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

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.

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.

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.

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.

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.

Zygote is a daemon whose goal is to launch Apps.

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

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

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.

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.

Android Development Environment

Your workbench for writing android applications

Based on Eclipse

Based on IntelliJ Community Edition

Based on Eclipse

Based on IntelliJ Community Edition

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

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)

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

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.

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

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:

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"

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

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

A SOFTWARE STACK FOR MOBILE DEVICES

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

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

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

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

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

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

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

Emulator

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

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

telnet localhost 554

help

power capacity 100

power ac offpower status not-charging

power capacity 5

power ac offhelp networkhelp network speed

network speed edge

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

network speed full

Android Device Manager

Android Device Manager

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

Android Device Manager

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

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.

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

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

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

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

~ End of part-1 ~