android part-1 - hello android

75
1 Bipin Jethwani

Upload: bipin-jethwani

Post on 15-Apr-2017

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Android Part-1 - Hello Android

1Bipin Jethwani

Page 2: Android Part-1 - Hello 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

2

Page 3: Android Part-1 - Hello Android

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

3

Page 4: Android Part-1 - Hello 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.

4

Page 5: Android Part-1 - Hello 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.

5

Page 6: Android Part-1 - Hello Android

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

6

Page 7: Android Part-1 - Hello Android

Android 1.5 Cupcake

7

Page 8: Android Part-1 - Hello Android

Android 1.6 Donut

8

Page 9: Android Part-1 - Hello 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

9

Page 10: Android Part-1 - Hello 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

10

Page 11: Android Part-1 - Hello Android

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

11

Page 12: Android Part-1 - Hello Android

Android 3.0 Honeycomb The first tablet-only Android update. Multi-core Processors

12

Page 13: Android Part-1 - Hello Android

Android 4.0 Ice Cream Sandwich Face Unlock

13

Page 14: Android Part-1 - Hello Android

Android 4.1 (Jelly Bean)(API level 16)

Android 4.1 Jelly Bean(API level 16)

14

Page 15: Android Part-1 - Hello Android

Android 4.2 Jelly Bean(API level 17)

15

Page 16: Android Part-1 - Hello Android

Android 4.4 KitKat(API level 19)

16

Page 17: Android Part-1 - Hello 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

17

Page 18: Android Part-1 - Hello 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.

18

Page 19: Android Part-1 - Hello Android

Android apps are written in the Javaprogramming language

19

Page 20: Android Part-1 - Hello Android

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

20

Page 21: Android Part-1 - Hello Android

21

Page 22: Android Part-1 - Hello 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.

22

Page 23: Android Part-1 - Hello 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.

23

Page 24: Android Part-1 - Hello Android

24

Page 25: Android Part-1 - Hello Android

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

25

Page 26: Android Part-1 - Hello 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.

26

Page 27: Android Part-1 - Hello Android

Application Sandboxing

27

Page 28: Android Part-1 - Hello Android

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

28

Page 29: Android Part-1 - Hello Android

Android OS is a multi-user Linux system

29

Page 30: Android Part-1 - Hello Android

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

30

Page 31: Android Part-1 - Hello Android

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

31

Page 32: Android Part-1 - Hello 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.

32

Page 33: Android Part-1 - Hello 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.

33

Page 34: Android Part-1 - Hello 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.

34

Page 35: Android Part-1 - Hello 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.

35

Page 36: Android Part-1 - Hello 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.

36

Page 37: Android Part-1 - Hello Android

37

Page 38: Android Part-1 - Hello Android

Zygote is a daemon whose goal is to launch Apps.

38

Page 39: Android Part-1 - Hello 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),

39

Page 40: Android Part-1 - Hello Android

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

40

Page 41: Android Part-1 - Hello 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.

41

Page 42: Android Part-1 - Hello 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.

42

Page 43: Android Part-1 - Hello Android

43

Page 44: Android Part-1 - Hello Android

44

Page 45: Android Part-1 - Hello Android

45

Page 46: Android Part-1 - Hello Android

Android Development Environment

Your workbench for writing android applications

46

Page 47: Android Part-1 - Hello Android

Based on Eclipse

Based on IntelliJ Community Edition47

Page 48: Android Part-1 - Hello Android

Based on Eclipse

Based on IntelliJ Community Edition

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

48

Page 49: Android Part-1 - Hello 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)

49

Page 50: Android Part-1 - Hello 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

50

Page 51: Android Part-1 - Hello Android

A SOFTWARE STACK FOR MOBILE DEVICES

51

Page 52: Android Part-1 - Hello Android

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

52

Page 53: Android Part-1 - Hello 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

53

Page 54: Android Part-1 - Hello 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

54

Page 55: Android Part-1 - Hello 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

55

Page 56: Android Part-1 - Hello 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

56

Page 57: Android Part-1 - Hello 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

57

Page 58: Android Part-1 - Hello 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

58

Page 59: Android Part-1 - Hello Android

59

Page 60: Android Part-1 - Hello Android

Emulator

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

60

Page 61: Android Part-1 - Hello 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

61

Page 62: Android Part-1 - Hello Android

telnet localhost 554

62

Page 63: Android Part-1 - Hello Android

help

63

Page 64: Android Part-1 - Hello Android

power capacity 100

64

Page 65: Android Part-1 - Hello Android

power ac offpower status not-charging

65

Page 66: Android Part-1 - Hello Android

power capacity 5

66

Page 67: Android Part-1 - Hello Android

power ac offhelp networkhelp network speed

67

Page 68: Android Part-1 - Hello Android

network speed edge

68

Page 69: Android Part-1 - Hello Android

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

69

Page 70: Android Part-1 - Hello Android

network speed full

70

Page 71: Android Part-1 - Hello Android

71

Page 72: Android Part-1 - Hello Android

72

Page 73: Android Part-1 - Hello Android

73

Page 74: Android Part-1 - Hello Android

74

Page 75: Android Part-1 - Hello Android

75