android - sisoft · android version & api level 12 platform version api level version_code...

26
Android Introduction Architecture Versions Components 1

Upload: others

Post on 13-Aug-2020

48 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

AndroidIntroduction

ArchitectureVersions

Components

1

Page 2: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Sisoft Android Basic

• Course Objectives• Familiarize with Android Development

Environment• Setup Android Development Platform• Understand the component of Android

framework• Develop basic UI in Android Studio• Create few basic application• This is pre-requisite for our Android Advance

Course.

2www.sisoft.in

Page 3: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

1. Introduction

What is Android?

• Android is an open-source platform• Android is operating system for mobile devices.

• It is based on the Linux kernel.

• Android is Framework for developing mobile apps. • Framework is set of Interfaces and classes .• Framework follows the structure.• Allows writing managed code in the Java language.

• It was founded by Andy Rubin in October 2003• Backed by Google in November 2007• Developed by Google and later the Open Handset Alliance (OHA).

• The Android platform was announced on 5 November 2007(Android beta) with the founding of OHA.

3www.sisoft.in

Page 4: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Android Architecture

4www.sisoft.in

Page 5: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Linux Kernel

• Device drivers

• Works as a Hardware Abstraction Layer

(HAL)

• Memory management

• Process management

• Networking

5www.sisoft.in

Page 6: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Libraries

• C/C++ libraries

• Interface through Java

• Surface manager – Handling UI Windows

• OpenGL|ES – Open Graphics Library for high

performance 2D and 3D graphics

• SGL – Scalable graphics Library

6www.sisoft.in

Page 7: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Libraries

• Free Type – Render text to bitmaps

• Media codecs, SQLite, Browser engine

7

Page 8: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Android Runtime

• Dalvik VM/ ART

Dex files

Compact and efficient than class files

Limited memory and battery power

• Core Libraries

Java 5 Std edition

Collections, I/O etc

8

Page 9: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Application Framework

• API interface

• Activity manager :- manages application life

cycle.

• XMPP Service :- Extensible Messaging and

Presence Protocol (XMPP) is a communications

protocol for message-oriented middleware based on

XML9

Page 10: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Applications

• Built in and user apps

• Can replace built in apps

10

Page 11: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

11

Version History

Nougat

Android 7.0

Page 12: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Android Version & API Level

12

Platform Version API Level VERSION_CODE

ANDROID 7.0 24 NOUGAT

Android 6.0 23 MARSHMALLOWS

Android 5.1 22 LOLLIPOP

Android 5.0 21 LOLLIPOP

Android 4.4 – 4.4.4 19 KITKAT

Android 4.3 18 JELLY_BEAN_MR2

Android 4.2, 4.2.2 17 JELLY_BEAN_MR1

Android 4.1, 4.1.1 16 JELLY_BEAN

Android 4.0.3, 4.0.4 15 ICE_CREAM_SANDWICH_MR1

Android 4.0, 4.0.1, 4.0.2 14 ICE_CREAM_SANDWICH

Android 3.2 13 HONEYCOMB_MR2

Android 3.1.x 12 HONEYCOMB_MR1

Android 3.0.x 11 HONEYCOMB

Page 13: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Android Version & API Level

www.sisoft.in 13

Platform Version API Level VERSION_CODE

Android 2.3.4 , Android 2.3.3 10 GINGERBREAD_MR1

Android 2.3.2 , Android 2.3.1,

Android 2.39 GINGERBREAD

Android 2.2.x 8 FROYO

Android 2.1.x 7 ECLAIR_MR1

Android 2.0.1 6 ECLAIR_0_1

Android 2.0 5 ECLAIR

Android 1.6 4 DONUT

Android 1.5 3 CUPCAKE

Page 14: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Nougat

1. Menu between the system settings.

2. split-screen multitasking and multi-window mode .

3. Direct reply from notification bar for all apps.

4. number blocking and call screening, improved Quick Setting tiles (and customization) and more.

5. Improved Doze Mode.

6. Redesigned Notification Panel.

7. Data Saver.

8. Auto Update.

9. Keyboard Themes.

MarshMellow

1. Google Now on Tap

2. Android Pay

3. Custom Google tabs

4. Having Individual App permissions.

5. New Power saver mode – Doze

6. Fingerprint recognition

7. Improved Copy and Pasting

14

Page 15: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Application Building Blocks

15

Page 16: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Application Building Blocks

• Components– Activity

– Service

– Content Provider

– Broadcast receivers

• Intent

• Content Resolver

• Resources

• Context

16www.sisoft.in

Android applications consist of loosely coupled components, bound by the

application manifest that describes each component and how they interact. The

manifest is also used to specify the application’s metadata, its hardware and

platform requirements, external libraries, and required permissions

Page 17: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Activities : Front end or Screen Holder

• An Activity represents the visual representation of an Android application. Typically correspond to one UI screen

• One activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time

• An application usually consists of multiple activities that are loosely bound to each other

17www.sisoft.in

Page 18: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Activities start each other

18www.sisoft.in

Moving from one activity to another is accomplished by having the

current activity start the next one through so called intents.

Page 19: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Activities

• Each activity has a default window to draw in (although it may prompt for dialogs or notifications)

• The content of the window is a view or a group of views (derived from View or ViewGroup)

• Example of views: buttons, text fields, scroll bars, menu items, check boxes, etc.

• View(Group) made visible via Activity.setContentView() method.

www.sisoft.in

Page 20: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Services: Background component

• A service is a component which runs in the background, without direct interaction with the user

• The Android platform provides and runs predefined system services and every Android application can use them, given the right permissions.

20www.sisoft.in

Page 21: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Broadcast Receivers: Passive Actor

• Receive and react to broadcast announcements

• Examples of broadcasts:

– internet connected, boot completed, power connected, shutdown, timezone changed, etc.

– Other applications can initiate broadcasts

• To create a new Broadcast Receiver, extend the BroadcastReceiver class and override the onReceive event handler

21 www.sisoft.in

Page 22: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Content Providers: Data Publication Mechanism

• Makes some of the application data available to other applications

• It’s the only way to transfer data between applications in Android (no shared files, shared memory, pipes, etc.)

• Extends the class ContentProvider

• Other applications use a ContentResolverobject to access the data provided via a ContentProvider

22 www.sisoft.in

Page 23: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Intent: Messenger

• An intent is an abstract description of an operation to be performed

• Moving from one activity to another is accomplished by having the current activity start the next one through intents

• The intents can communicate messages among any of the three core components of an application -activities, services, and broadcast receivers

• Data across components is also passed thru intents

23www.sisoft.in

Page 24: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Content Resolver: Data Access Mechanism

• The Content Resolver object communicates with the provider object

• The Content Resolver object in the client application's process and the Content Provider object in the application that owns the provider automatically handle inter-process communication

• To access a provider, your application usually has to request specific permissions in its manifest file

• Android itself includes content providers that manage data such as audio, video, images, and personal contact information

24www.sisoft.in

Page 25: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Resources: Non-Code Assets

• Android supports that resources like images and certain XML configuration files, can be kept separate from the source code.

• Resource files must be placed in the /res directory in a predefined sub-folder dependent on their type. You can also append additional qualifiers to the folder name to indicate that the related resources should be used for special configurations.

• For example, you can specify that layout file is only valid for a certain screen size.

www.sisoft.in25

Page 26: ANDROID - Sisoft · Android Version & API Level 12 Platform Version API Level VERSION_CODE ANDROID 7.0 24 NOUGAT Android 6.0 23 MARSHMALLOWS Android 5.1 22 LOLLIPOP Android 5.0 21

Context: environment data

• Interface to global information about an application environment.

• This is an abstract class whose implementation is provided by the Android system.

• It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.

www.sisoft.in26