android bluetooth robot

45
Android Sathish.R

Upload: sathish-raju

Post on 27-May-2015

1.815 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Android  bluetooth robot

AndroidSathish.R

Page 2: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 3: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 4: Android  bluetooth robot

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.

Introduction: Android

Tenet Technetronics

Page 5: Android  bluetooth robot

History of Androido Android was the brainchild of Andy Rubin and Rich Miner.

(Android Inc.)

o Google acquired Android Inc. on August 17, 2005.

o Android was unveiled as its first product, a mobile device platform built on the Linux kernel version 2.6, On November, 2007

Tenet Technetronics

Page 6: Android  bluetooth robot

Android Evolutiono Android 1.1 -1.5 Cupcakeo Android 1.6 Donuto Android 2.0-2.1 Eclairo Android 2.2.x Froyoo Android 2.3.x GingerBreado Android 3.x Honeycombo Android 4.0.x Ice Cream Sandwicho Android 4.1.x-4.3.x Jelly Beano Android 4.4 Kitkat

Tenet Technetronics

Page 7: Android  bluetooth robot

o Application Frameworko Dalvik Virtual Machineo Integrated Browsero 2D and 3D graphics using the OpenGL libraries.o SQLite Database.o Video and Audio Codecs.o Bluetooth, EDGE,3G,4G and Wi-Fi .o Camera , GPS , Compass, and accelerometer.

Android Features

Tenet Technetronics

Page 8: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 9: Android  bluetooth robot

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 Example: Eclipse, Net beans, Android Studio,

Processing, Xamarin Studio, etc., Tenet Technetronics

Page 10: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 11: Android  bluetooth robot

Android Development Toolso Java JDK.o Eclipse or Net Beans.o ADT (Android Development Tools) .o Android SDK 1.0-4.0(Download from

developer.android.com).o Programming Languages.o Java – officially supported.o C/C++ – also possible but not supported.

Tenet Technetronics

Page 12: Android  bluetooth robot

Download JDK

Tenet Technetronics

Page 13: Android  bluetooth robot

Tenet Technetronics

Page 14: Android  bluetooth robot

Download Android SDK

Tenet Technetronics

Page 15: Android  bluetooth robot

Tenet Technetronics

Page 16: Android  bluetooth robot

Download Eclipse IDE

Tenet Technetronics

Page 17: Android  bluetooth robot

Install ADT PluginEclipse – Help – Install New software

Tenet Technetronics

Page 18: Android  bluetooth robot

Windows -> Preferences.

Select Android and enter the installation path of the Android SDK.

Entering SDK Path

Tenet Technetronics

Page 19: Android  bluetooth robot

Select Window -> Android SDK Manager from the menu.

Tenet Technetronics

Page 20: Android  bluetooth robot

Creating Android Virtual DeviceSelect Window -> Android AVD Manager from the menu.

Tenet Technetronics

Page 21: Android  bluetooth robot

Create Android Virtual Device

Tenet Technetronics

Page 22: Android  bluetooth robot

Tenet Technetronics

Page 23: Android  bluetooth robot

Android Emulator(AVD)

Tenet Technetronics

Page 24: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 25: Android  bluetooth robot

Tenet Technetronics

Page 26: Android  bluetooth robot

Tenet Technetronics

Page 27: Android  bluetooth robot

Android Framework

Tenet Technetronics

Page 28: Android  bluetooth robot

Application Building Blockso Activityo Intent Receivero Content Provider

Tenet Technetronics

Page 29: Android  bluetooth robot

Application Lifecycle Application run in their own processes (VM, PID). Processes are started and stopped as needed to run an

application's components. Processes may be killed to reclaim resources.

Tenet Technetronics

Page 30: Android  bluetooth robot

Android Devices

Tenet Technetronics

Page 31: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 32: Android  bluetooth robot

Buttonso Represents a push-button widget.o can be pressed, or clicked to perform an action.

Tenet Technetronics

Page 33: Android  bluetooth robot

Toast Messages:o A small popup.o It only fills the amount of space required for the

message and the current activity remains visible and interactive.

Tenet Technetronics

Page 34: Android  bluetooth robot

AgendaAndroid IntroductionIntroduction about IDE?Setting Up Environment.First ApplicationButton And Toast ApplicationBluetooth Applications AndroidTenet Technetronics

Page 35: Android  bluetooth robot

Bluetootho wirelessly exchange data with other Bluetooth

devices.o  access to the Bluetooth functionality APIs.o Using the Bluetooth APIs, We can perform the

following: Scan for other Bluetooth devices Query the local Bluetooth adapter for paired Bluetooth

devices Establish RFCOMM channels Connect to other devices through service discovery Transfer data to and from other devices. Tenet Technetronics

Page 36: Android  bluetooth robot

BluetoothThe four major tasks necessary to communicate using Bluetooth:osetting up Bluetoothofinding devices that are either paired or available in the local area,oconnecting deviceso transferring data between devices.All of the Bluetooth APIs are available in the android.bluetooth package. 

Tenet Technetronics

Page 37: Android  bluetooth robot

To Create Bluetooth ConnectionWe need the following:Bluetooth adapter.Bluetooth device.Bluetooth socket.Bluetooth Server Socket.

Tenet Technetronics

Page 38: Android  bluetooth robot

Permissionso you must declare the Bluetooth

permission BLUETOOTH. o If We discover Bluetooth devices or pair a device

we must use Bluetooth Admin permission.o  Most applications need this permission solely for

the ability to discover local Bluetooth devices.

Tenet Technetronics

Page 39: Android  bluetooth robot

Setting up Bluetootho Verify device that Bluetooth is supported or not.

o If supported enable Bluetooth as follows

Tenet Technetronics

Page 40: Android  bluetooth robot

Setting up Bluetootho Request to switch on the Bluetooth

o Find Bluetooth Devices.find remote Bluetooth devices either through device discovery or by querying the list of paired (bonded) devices.

Tenet Technetronics

Page 41: Android  bluetooth robot

Find Bluetooth Device

o Querying Paired Deviceso We can get paired devices by

getBondedDevices().This method will return all the paired devices.

Tenet Technetronics

Page 42: Android  bluetooth robot

Connecting Deviceso Android(Client)-Robot(Server)o Server’s MAC address to initiate

connection.o Initiate connection by calling connect()

method.o Get Output stream() of the device.o Write using the method write(byte[]).

Tenet Technetronics

Page 43: Android  bluetooth robot

Connecting a Device:

Tenet Technetronics

Page 44: Android  bluetooth robot

Conclusiono Android is open to all: industry, developers and

users.o Participating in many of the successful open

source projects.o Aims to be as easy to build for as the web.o Google Android is stepping into the next level of

Mobile Internet.

Tenet Technetronics

Page 45: Android  bluetooth robot

Tenet Technetronics