android introduction

41
Su Surendra ([email protected]) Sainath ([email protected])

Upload: saivvit

Post on 19-May-2015

102 views

Category:

Software


3 download

DESCRIPTION

Android Intorduction and Developement Basics

TRANSCRIPT

Page 1: Android Introduction

Su

Surendra ([email protected])

Sainath ([email protected])

Page 2: Android Introduction

A mobile phone that is able to perform many of the

functions of a computer, typically having an operating

system capable of running general-purpose applications

What is Smart Phone?

Page 3: Android Introduction

• An open source, open platform for mobile development.

• All the SDK, API, and platform source is available.

• No licensing, no app review.

• Replace any system app with your own.

What is Android?

Page 4: Android Introduction

Android API Versions

Page 5: Android Introduction

• Motion sensors

• Environmental sensors

• Position sensors

Sensors in Android Device

Page 6: Android Introduction

• Accelerometer

It is used to present landscape or portrait views of the device's screen, based

on the way the device is being held.

• Gyroscope

The gyroscope measures the rate or rotation in rad/s around a device's x, y,

and z axis.

• Rotation Vector Sensor

The rotation vector represents the orientation of the device as a combination

of an angle and an axis.

Motion sensors

Page 7: Android Introduction

• Humidity Sensor

• Light Sensors

• Pressure Sensors

• Temperature Sensors

Environment Sensors

Page 8: Android Introduction

• Orientation Sensor

Monitor the position of a device relative to the earth's frame of reference.

• Geomagnetic Field Sensor

Monitor changes in the earth's magnetic field.

• Proximity Sensor

It determine how far away an object is from a device.

Position Sensors

Page 9: Android Introduction

Screen Orientation

Page 10: Android Introduction

Complete About Android

Company / developer Google & Open Handset Alliance

Written in C (Core), C++, Java (User Interface)

OS family Unix-like

Source model Open source and in most devices with proprietary components

License Apache License 2.0 & Modified Linux kernel under GNU GPL v2

Initial release September 23, 2008

Latest release 4.4.2 KitKat/ December 9, 2013

Marketing target Smartphones & Tablet computers

Available in Multi-lingual (46 languages)

Package manager Google Play, APK

Supported platforms 32-bit ARM, MIPS, x86

Kernel type Monolithic (modified Linux kernel)

Default user interface Graphical (Multi-touch)

Page 11: Android Introduction

Developer Tools• Eclipse + ADT plugin

• Android SDK Tools

• Android Platform-tools

• The latest Android platform

• The latest Android system image for the emulator

• Android Studio

Page 12: Android Introduction

The Basic Steps

Page 13: Android Introduction

The Basic Steps

Page 14: Android Introduction

The Basic Steps

Page 15: Android Introduction
Page 16: Android Introduction

Application Fundamentals• Activities

• Services

• Content providers

• Broadcast receivers

• The Manifest File

Page 17: Android Introduction

Application Fundamentals• User Interface

• App Resources

• Animation and Graphics

• Computation

• Media and Camera

• Location and Sensors

• Connectivity

• Text and Input

• Data Storage

Page 18: Android Introduction

The Manifest File• Every application must have an AndroidManifest.xml file.

• It presents essential information about the application.

Structure of the Manifest File

<?xml version="1.0" encoding="utf-8"?><manifest>

<uses-permission /><uses-sdk />:<application>

<activity><intent-filter>

<action /><category />

</intent-filter></activity>::

</application></manifest>

Page 19: Android Introduction

Activities• An Activity is an application component that provides a

screen with which users can interact in order to do

something

Creating an Activity:

1. Create a subclass of android.app.Activity (i.e extend android.app.Activity)

2. Override onCreate() method

3. setContentView() to define the layout

Manifest.xml<activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">

<intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" />

</intent-filter></activity>

Page 20: Android Introduction

Managing the Activity Lifecycle1. Resumed

2. Paused

3. Stopped

Page 21: Android Introduction

LayoutsA layout defines the visual structure for a user interface.

• Declare UI elements in XML.

• Instantiate layout elements at runtime.

Page 22: Android Introduction

Common Layouts

Linear Layout Relative Layout Web View

A layout that organizes its children into a single horizontal or vertical row. It creates a scrollbar if the length of the window exceeds the length of the screen.

Enables you to specify the location of child objects relative to each other (child A to the left of child B) or to the parent (aligned to the top of the parent).

Displays web pages.

Page 23: Android Introduction

Building Blocks

Your inventory of ready-to-use elements for creating outstanding apps.

Page 24: Android Introduction

Widgets (Controls)1. Button

2. Text field

• EditText

• AutoCompleteTextView

3. Checkbox

4. Radio button

• RadioButton

• Toggle button

5. Toggle button

6. Spinner

7. Toasts

8. Seek Bars and Sliders

9. Pickers

• DatePicker

• TimePicker

Page 25: Android Introduction

Buttons• A button consists of text or an icon (or both text and an

icon) that communicates what action occurs when the user

touches it.

<Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/button_text"... />

Page 26: Android Introduction

Text Fields• A text field allows the user to type text into your app.

<EditTextandroid:id="@+id/email_address"android:layout_width="fill_parent"android:layout_height="wrap_content"android:hint="@string/email_hint"android:inputType="textEmailAddress" />

Page 27: Android Introduction

android:inputType• “text"

Normal text keyboard.

• "textEmailAddress"

Normal text keyboard with the @ character.

• "textUri"

Normal text keyboard with the / character.

• "number"

Basic number keypad.

• "phone"

Phone-style keypad.

Page 28: Android Introduction

Checkbox• Checkboxes allow the user to select one or more options

from a set. Typically, you should present each checkbox

option in a vertical list.

<CheckBox android:id="@+id/checkbox_meat"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/meat"... />

Page 29: Android Introduction

Radio Buttons• Radio buttons allow the user to select one option from a

set. <RadioGroup>android:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="vertical"><RadioButton android:id="@+id/radio_pirates"

android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/pirates"android:onClick="onRadioButtonClicked"/>

<RadioButton android:id="@+id/radio_ninjas"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/ninjas"android:onClick="onRadioButtonClicked"/>

</RadioGroup>

Page 30: Android Introduction

Toggle Buttons• A toggle button allows the user to change a setting

between two states.

<ToggleButtonandroid:id="@+id/togglebutton"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textOn="Vibrate on"android:textOff="Vibrate off"android:onClick="onToggleClicked"/>

Toggle buttons

Switches (in Android 4.0+)

Page 31: Android Introduction

Spinners• Spinners provide a quick way to select one value from a set.

<Spinnerandroid:id="@+id/planets_spinner"android:layout_width="fill_parent"android:layout_height="wrap_content" />

Page 32: Android Introduction

Toasts• A toast provides simple feedback about an operation in a

small popup.

Context context = getApplicationContext();String text = "Hello toast!";int duration = Toast.LENGTH_SHORT;

Toast toast = Toast.makeText(context, text, duration);toast.show();

Page 33: Android Introduction

Dialogs• Dialogs prompt the user for decisions or additional

information required by the app to continue a task.

1. Optional title region 2. Content area 3. Action buttons

Page 34: Android Introduction

Seek Bars and Sliders• Interactive sliders make it possible to select a value from a

continuous or discrete range of values by moving the slider

thumb.

Page 35: Android Introduction

Pickers• Pickers provide a simple way to select a single value from a

set.

Date & Time Pickers:

Page 36: Android Introduction

Google Services

Build new revenue streams, manage app distribution, track

app usage, and enhance your app with features such as

maps, sign-in, and cloud messaging.

Page 37: Android Introduction

Google Services

Google Maps Google Play In-App Billing

Google Wallet Instant Buy

Google Cloud Messaging

Google Analytics

Google Cloud Platform

Google Mobile Ads

Google+

Google Play Game Services

Location APIs

Page 38: Android Introduction

Nexus Family

Page 39: Android Introduction

Android Wear

Page 40: Android Introduction

Google Glass

Page 41: Android Introduction

Follow us: /+GdgvijayawadaBlogspot

/GDGVijayawada

/GDGVijayawada