50
Sathish.R

Android introduction session 1

Embed Size (px)

Citation preview

Page 1: Android introduction session 1

Sathish.R

Page 2: Android introduction session 1

o Introduction About

Android.

o IDE Introduction.

o Setting Up

Environment.

o Dalvik Virtual

Machine.

Android

Introduction

Session 2

2

Tenet Technetronics

13 November, 2013

Page 3: Android introduction session 1

o Introduction About

Android.

Android

Introduction

Session 2

3

Tenet Technetronics

13 November, 2013

Page 4: Android introduction session 1

What is Android? o Operating system based on Linux.

o Open Source by Search Giant.

o Apps typically written in Java.

o Apps run on the Dalvik Virtual Machine(DVM).

o November 2007, Open Handset Alliance formed to develop open standards for mobile devices.

Open Handset Alliance:

o Google formed a group of hardware, software, and

telecommunication companies with the goal of

contributing to Android development

4

Tenet Technetronics

13 November, 2013

Page 5: Android introduction session 1

Android

5

Tenet Technetronics

13 November, 2013

Page 6: Android introduction session 1

History

o Android Inc. was founded by Andy Rubin, Rich miner, Nick

sears and Chris White in 2003.

o Acquired by Google in July 2005.

o The first android phone was HTC G1 Dream(with cupcake)

Released in October 2008.

6

Tenet Technetronics

13 November, 2013

Page 7: Android introduction session 1

Android Evolution 7

Tenet Technetronics

13 November, 2013

Page 8: Android introduction session 1

Android Features o Open Source framework

o Very simple.

o Availability of Apps.

o Supports 2D,3D graphics.

o Java support.

o Easy to customize.

o Better Notification System(email and various widgets).

o SQLite Database.

o Bluetooth, EDGE,3G,4G and Wi-Fi .

o Camera ,GPS,Compass, and accelerometer.

8

Tenet Technetronics

13 November, 2013

Page 9: Android introduction session 1

9

Framework 13 November, 2013

Tenet Technetronics

Page 10: Android introduction session 1

10

Application Components

Activities – visual user interface focused on a single thing a user can do

Services – no visual interface – they run in the background

Broadcast Receivers – receive and react to broadcast announcements

Content Providers – allow data exchange between applications

13 November, 2013

Tenet Technetronics

Page 11: Android introduction session 1

o Introduction About

Android.

o IDE Introduction.

Android

Introduction

Session 2

11

Tenet Technetronics

13 November, 2013

Page 12: Android introduction session 1

IDE: (Integrated

Development Environment) o Programming Environment that consists of

A Code Editor,

A compiler,

A Debugger,

A GUI builder.

o User-Friendly Framework.

o Eclipse, Net beans, Android Studio, Processing, Xamarin Studio, etc.,

12

Tenet Technetronics

13 November, 2013

Page 13: Android introduction session 1

o Introduction About Android.

o IDE Introduction.

o Setting Up

Environment.

Android

Introduction

Session 2

13

Tenet Technetronics

13 November, 2013

Page 14: Android introduction session 1

Development Tools:

o Java JDK.

o Eclipse or Net beans.

o Android Development Tools(ADT Plugin).

o Android latest SDK

o Programming Languages

Java

14

Tenet Technetronics

13 November, 2013

Page 15: Android introduction session 1

o Run Eclipse.chm file and proceed with the

instructions

15

Installation

Tenet Technetronics

13 November, 2013

Page 16: Android introduction session 1

o Introduction About

Android.

o IDE Introduction.

o Setting Up

Environment.

o Dalvik Virtual

Machine.

Android

Introduction

Session 2

16

Tenet Technetronics

13 November, 2013

Page 17: Android introduction session 1

Dalvik Virtual Machine o Java-” write once, run anywhere”.

o Software that runs the apps on Android devices.

o Invented by Dan Bornstein(Google).

o Register-based.

o A tool called dx is used to convert some (but not all) Java .class files into the .dex (Dalvik Executable)format.

Tenet Technetronics

17 13 November, 2013

Page 18: Android introduction session 1

DVM

o run on a slow CPU

o Multiple classes are included in a single

.dex file.

Tenet Technetronics

18

source code Java compiler dx

(conversion tool) .class file

.dex file (Dalvik

executable)

13 November, 2013

Page 19: Android introduction session 1

19

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 20: Android introduction session 1

20

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 21: Android introduction session 1

Select File -> New -> Other -> Android -> Android Project

13 November, 2013

Tenet Technetronics

21

Page 22: Android introduction session 1

Tenet Technetronics

13 November, 2013 22

Page 23: Android introduction session 1

Tenet Technetronics

13 November, 2013 23

Page 24: Android introduction session 1

Tenet Technetronics

13 November, 2013 24

Page 25: Android introduction session 1

Tenet Technetronics

13 November, 2013 25

Page 26: Android introduction session 1

Tenet Technetronics

13 November, 2013 26

Page 27: Android introduction session 1

27

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 28: Android introduction session 1

Layouts

o Linear Layout

o Relative Layout

o Frame Layout

o Table Layout

Tenet Technetronics

28 13 November, 2013

Page 29: Android introduction session 1

Linear Layout

oAll the elements are displayed in a linear

fashion

oHorizontally or Vertically

Tenet Technetronics

29 13 November, 2013

Page 30: Android introduction session 1

Relative Layout

o Designed to display child View controls in relation to each other

o Every element arranges itself relative to other elements or a parent element.

Tenet Technetronics

30 13 November, 2013

Page 31: Android introduction session 1

Table Layout

o Designed to organize

child View controls into rows and columns.

o Divide your layouts

into rows and columns.

Tenet Technetronics

31 13 November, 2013

Page 32: Android introduction session 1

Frame Layout oDisplay only a single UI

element at a time, or multiple

UI elements within Frame

Layout

oEach element will be

positioned based on the top

left of the screen.

Tenet Technetronics

32 13 November, 2013

Page 33: Android introduction session 1

Drawables

o referencing an image

file from your project

resources.

o Supported file types are

PNG and JPG.

o Background image for

Layout, button, etc..

Tenet Technetronics

33 13 November, 2013

Page 34: Android introduction session 1

34

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 35: Android introduction session 1

Activity Navigation

o Moving From one Activity to another.

o Pass values from one activity to another

Activity (Intents).

o Example.

Tenet Technetronics

35 13 November, 2013

Page 36: Android introduction session 1

36

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 37: Android introduction session 1

Views And View Groups

we can declare the layout in two ways:

o Programmatically

o Declaring the widgets or UI elements in

XML.

The layout consists of Views and View

Groups.

Tenet Technetronics

37 13 November, 2013

Page 38: Android introduction session 1

View Groups

o Layouts are called View groups

o In which the child Views or View Groups

are arranged either vertically or

horizontally.

o Example

Tenet Technetronics

38 13 November, 2013

Page 39: Android introduction session 1

39

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 40: Android introduction session 1

Manifest and Permissions o A resource file which contains all the details

needed by the android system about the

application.

o This is an xml file which must be named as

AndroidManifest.xml and placed at application

root.

Tenet Technetronics

40 13 November, 2013

Page 41: Android introduction session 1

Android Manifest It allows us to define

o The packages, API, libraries needed for the application.

o Basic building blocks of application like activities, services and etc.

o Details about permissions.

o Set of classes needed before launch.

Tenet Technetronics

41 13 November, 2013

Page 42: Android introduction session 1

Elements of AndroidManifest.xml o uses-permission

o permission

o permission-group

o permission-tree

o Instrumentation

o uses-sdk

o uses-configuration

o uses-feature

o supports-screens, compatible-screens

o supports-gl-texture

Tenet Technetronics

42 13 November, 2013

Page 43: Android introduction session 1

Elements of Manifest o uses-permission purpose of security.

o permission Access Control.

o uses- sdk the platform compatibility.

o uses-configuration set of hardware and software requirement.

o supports-screens,

and compatible-screens screen configuration mode and size of the screen

Tenet Technetronics

43 13 November, 2013

Page 44: Android introduction session 1

Example

Tenet Technetronics

44 13 November, 2013

Page 45: Android introduction session 1

45

o First Application (Hello World)

o Layouts & Drawables

o Activity Navigation

o View Group & Views

o Manifest & Permissions

o Menus & Tabs

Tenet Technetronics

Applications

13 November, 2013

Page 46: Android introduction session 1

Menu o A common user interface component in

many types of applications.

o Interface for managing the items in a menu.

o If you're developing for Android 2.3 or lower, users can reveal the options menu panel by pressing the Menu button.

Tenet Technetronics

46 13 November, 2013

Page 47: Android introduction session 1

Menu

o Context menus a floating list of menu items that appears when a user

touches and holds a particular item displayed in the view

o Options menus the one that appears when a user touches the menu

button on the mobile.

o Sub menus a floating list of menu items that appears when the user

touches a menu item that contains a nested menu

Tenet Technetronics

47 13 November, 2013

Page 48: Android introduction session 1

Tabs o A nice way to present multiple

thing on a Single Screen

o Tabs in the action bar make it easy to explore and switch between different views or functional aspects.

o Example

Tenet Technetronics

48 13 November, 2013

Page 49: Android introduction session 1

Tenet Technetronics

49 13 November, 2013

Page 50: Android introduction session 1

Tenet Technetronics

50 13 November, 2013