andriod developer training

30
Welcome to ANDROID DAY ONE CLASS

Upload: kernel-training

Post on 17-Jul-2015

335 views

Category:

Education


2 download

TRANSCRIPT

Welcome to ANDROID DAY ONE CLASS

Android in a nutshell

www.kerneltraining.com/android-development

Product of OHA (Open Handset Alliance) led by Google.

Software Platform that provides a framework to develop applications for mobile devices.

It includes an OS, middleware and key applications.

Layered platform built on Linux kernel.

Android Powered Devices

www.kerneltraining.com/android-development

Android Features

www.kerneltraining.com/android-development

• Android’s UI includes Windows, Views, Widgets

• Android provides an integrated browser engine –Webkit

• Connectivity – Wi Fi, GPRS, Bluetooth, EDGE, 3G

• SQLite for structured data storage

• Supports GSM telephony, media, camera, compass, accelerometer (hardware dependent)

• Provides 2D and 3D graphics with OpenGL library

Design Philosophy

www.kerneltraining.com/android-development

Small footprint

Power efficiency

Multitasking

Minimal startup time

Quick response to user activity

Support multiple screen

resolutions

Memory protection

Extensible

Platforms Roadmap

www.kerneltraining.com/android-development

2008 1.5-Cupcake

20091.6-

Donut

2.0-Eclair

2.2-Froyo

2.3-Gingerbread3.0-Honeycomb

4.0-Icecream sandwich

4.1-Jelly bean

4.4-KitKat

OS market share –Q3 2014

www.kerneltraining.com/android-development

Source: IDC.

Vendor market share –Q3 2014

www.kerneltraining.com/android-development

Source: IDC.

Statistics galore!

www.kerneltraining.com/android-development

• Smartphone market grew 27.2% year over year in 2014 Q3

• 2014 promises to close at nearly 1.3 billion shipments

• Samsung is the only top five company which had a negative change.

• Apple had its largest Q3 volume sale with the launch of iPhone 6.

• Xiaomi jumped to third position with triple-digit growth

Building Android Apps using

www.kerneltraining.com/android-development

www.kerneltraining.com/android-development

Project View

sign/Text Swit1 Project View

122

Design/Text Switch

3Editor View

SDK Manager

www.kerneltraining.com/android-development

Project View

sign/Text Switch

• Used to download

Android SDK in modular

packages as and when

it is released

• Also used to download

latest contents

specifically whenever it

gets updated

AVD Manager

www.kerneltraining.com/android-development

Project View

sign/Text Switch

• Create and manage Android Virtual Devices(AVDs)

Android Virtual Device(AVD)

www.kerneltraining.com/android-development

Project View

sign/Text Switch

• A QEMU-based virtual mobile device

• An emulation tool used to design, debug, and test Android

applications in an Android run-time environment. The emulator

supports AVD configurations.

Emulated Device Key Keyboard Key

Home HOME

Back ESC

Call/dial button F3

Hangup/end call button F4

Search F5

Power button F7

Audio volume up button KEYPAD_PLUS, Ctrl-F5

Audio volume down button KEYPAD_MINUS, Ctrl-F6

Switch to previous layout orientation (for example, portrait, landscape)

KEYPAD_7, Ctrl-F11

Android Project Structure

www.kerneltraining.com/android-development

Android app - Anatomy

www.kerneltraining.com/android-development

Project View

sign/Text Switch

• java folder – contains

source files

• res – contains non-code

resources such as

images

• Gradle scripts – contains

build scripts used

internally

• Manifests – contains the

Android Manifest file

Debugging using DDMS(Dalvik Debug Monitor Server)

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Flat files

App Development Procedure

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Android API

SDK / NDK

Programming

Language

Data Handling

Flat files

Test, Sign & Package

AAPTKeytool

Publishing

GooglePlay

Views - Introduction

www.kerneltraining.com/android-development

lGoogle

Play

Views

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Flat files

lGoogle

Play

Android provides a wide variety of UI Elements called views.

Following are some of the most commonly used views:

– Button

– TextView

– EditText

– ListView

A view can be customized by setting its properties at the time of

declaration in the layout xml file.

We can provide id to a view to be able to manipulate it using Java code.

– Checkbox

– RadioButton

– Spinner

– ImageView

TextView

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Flat files

lGoogle

Play

TextView is used as a UI component in Android to display non-

editable information in the UI.

<TextView> tag is used in the layout XML file to create a

TextView.

Some of the most important attributes for TextView are:

android:layout_width : specifies the width

android:layout_height : specifies the height

android:text : specifies the text displayed

android:id : specifies the id of the view

TextView

www.kerneltraining.com/android-development

Project View

sign/Text Switch

lGoogle

Play

<TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_centerVertical="true"android:text="Hi, this is my info

page“android:id="@+id/myMessage"

/>

TextView

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Flat files

lGoogle

Play

Adding android:id attribute to the TextView tag generates a unique id which is associated with the current TextView.

This id can be used to manage the TextView in the activity code as follows:

@Overridepublic void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);TextView tv =

(TextView)findViewById(R.id.myMessage);tv.setText("I have changed the text

dynamically!");}

Button

www.kerneltraining.com/android-development

Project View

sign/Text Switch

Flat files

lGoogle

Play

<Button> tag is used to generate a button in an Android

application.

Some of the important attributes for button are:

— android:layout_width

— android:layout_height

— android:text

— android:id

The click of a button generates a click event

This event is handled by onClick() method of OnClickListener

interface

THANK YOUfor attending Demo of

www.kerneltraining.com/android-development