SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Smartphone++
Marc Lester S. Tan
Mobile Applications Developer, SAP

GDG Devfest Kota Kinabalu 2013
Agenda
●  Overview of Arduino
●  Google ADK
●  Uses of ADK and Demo
Overview of Arduino
Overview of Arduino
• 

Open-source electronics prototyping
platform.

• 

Intended for Artists, Designers and
Hobbyists.

• 

Arduino Programming Language based
on Wiring.

• 

Arduino IDE based on Processing

source: http://www.arduino.cc
Overview of Arduino
• 

Inexpensive

• 

Cross-platform

• 

Simple and clear programming environment.

• 

Open-source software and hardware
Arduino Shields
Shields are boards that can be plugged on top
of the Arduino PCB extending its capabilities.

• 

SD Card Shield

• 

USB Host Shield

• 

Ethernet Shield
source:
http://blog.protoneer.co.nz/
Arduino IDE
• 

Java

• 

Based on Processing IDE
(processing.org)

• 

Write and upload code to Arduino
board
Arduino Sketch
• 

setup()
o  called once
o  setup pin modes
o  library initialization

• 

loop()
o  called over the over again
o  heart of every sketches
Sample Sketch
int inputPin = 12;

// let pin 12 be our input pin

int outputPin = 11;

// let pin 11 be our ouput pin

void setup(){
pinMode(outputPin, OUTPUT);

// setup output pin to be an OUTPUT

pinMode(inputPin, INPUT);

// setup input pin to be our INPUT

}
void loop(){
int inputVal = digitalRead(inputPin);
digitalWrite(outputPin, inputVal);
delay(100);
}

// write the value of input pin to output
// wait for 100ms
// before looping again.
Google ADK
USB on Android
Host Mode

Power

Data Transfer

Accessory Mode

Power

Data Transfer
Google ADK
●  Reference implementation for
hardware manufacturers and
hobbyists.
●  It uses Android Open Accessory
Protocol over USB or Bluetooth
●  The hardware is based on
Arduino Mega.
●  Two versions: ADK 2011 and
ADK 2012

source: http://www.engadget.com/gallery/googles-arduino-based-adk-hands-on-atgoogle-i-o-2011/
Hello, Physical World
• 

Design and create the hardware or
circuit.

• 

Write the firmware for your
Arduino.

• 

Create an Android application that
can talk to your firmware.

source: http://www.youtube.com/watch?v=gcP7KwIENGw
Design and Create the Hardware
• 

Use Fritzing to design your
breadboard, schematic diagram
and bill of materials.

• 

Get it from http://fritzing.org/
Write the Firmware
if (acc.isConnected()) {
int len = acc.read(msg, sizeof(msg), 1);
if(len > 0){
Serial.println(len);
if(msg[0] == 0x1){
digitalWrite(13, HIGH);
}else{
digitalWrite(13, LOW);
}
}
}else{
digitalWrite(13, LOW);
}
Create the Android Application
● 

USBManager - available since 3.1 but also available for 2.3.4 using Google API 10
○ 

● 

Not all devices support accessory mode

Android Manifest Requirements:
Declare:
<uses-feature android:name="android.hardware.usb.accessory" />
If using Add-on:
<application….>
<uses-library android:name="com.android.future.usb.accessory" />
Create the Android Application
Android Manifest Requirements:
<activity ...>
...
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /
>
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter" />
</activity>
Create the Android Application
res/xml/accessory_filter.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-accessory manufacturer="Marc Tan" model="Motor Control" version="1.0" />
</resources>
Create the Android Application
onCreate()...
mUsbManager = UsbManager.getInstance(this);
onResume()...
UsbAccessory[] accessories = mUsbManager.getAccessoryList();
UsbAccessory accessory = accessories[0]);
if (mUsbManager.hasPermission(accessory)) {
openAccessory(accessory);
}
Create the Android Application
protected void openAccessory(UsbAccessory accessory) {
fileDescriptor = mUsbManager.openAccessory(accessory);
FileDescriptor fd = fileDescriptor.getFileDescriptor();
input = new FileInputStream(fd);
output = new FileOutputStream(fd);
}
onDestroy()...
output.write(0); // optional
fileDescriptor.close();
Uses of ADK and Demo
Uses of ADK
Audio Docking Station
Uses of ADK
Exercise Machines
Uses of ADK
Weather Stations
Uses of ADK
Home Automation
Demo: Sonar
Demo: Motor Control
Demo: Android as USB Host
Resources
Android ADK
a.android.com

Arduino and Electronics, Others
arduino.cc
tronixstuff.com
hackaday.com
My Blog and Github
marctan.com
github.com/mharkus
Quadcopter
bitcraze.se
Thank you
Questions?

Contenu connexe

Tendances

Development, debug and deploy hardware/software solutions based on Android an...
Development, debug and deploy hardware/software solutions based on Android an...Development, debug and deploy hardware/software solutions based on Android an...
Development, debug and deploy hardware/software solutions based on Android an...Илья Родин
 
Making arduino-talk-with-android-using-amarino
Making arduino-talk-with-android-using-amarinoMaking arduino-talk-with-android-using-amarino
Making arduino-talk-with-android-using-amarinoSudar Muthu
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolGary Bisson
 
Open hack 2011-hardware-hacks
Open hack 2011-hardware-hacksOpen hack 2011-hardware-hacks
Open hack 2011-hardware-hacksSudar Muthu
 
Internet-of-Things with (Arduino+XBee)
Internet-of-Things with (Arduino+XBee)Internet-of-Things with (Arduino+XBee)
Internet-of-Things with (Arduino+XBee)santiagojbt
 
How to build your own Android devices @ Google Developer Day 2012
How to build your own Android devices @ Google Developer Day 2012How to build your own Android devices @ Google Developer Day 2012
How to build your own Android devices @ Google Developer Day 2012Toriningen,Inc.
 
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT CoreHands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT CoreAndri Yadi
 
Introduction to Internet of Things Hardware
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things HardwareDaniel Eichhorn
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino ProgrammingJames Lewis
 
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.jsRaspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.jsAndri Yadi
 
Confusion of Things — The IoT Hardware Kerfuffle
Confusion of Things — The IoT Hardware KerfuffleConfusion of Things — The IoT Hardware Kerfuffle
Confusion of Things — The IoT Hardware KerfuffleOmer Kilic
 
iPad Music Production iO Dock Product Overview
iPad Music Production iO Dock Product OverviewiPad Music Production iO Dock Product Overview
iPad Music Production iO Dock Product OverviewAlesisUS
 
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCING
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCINGINTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCING
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCINGDevyani Chaudhari
 
GDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoTGDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoTAndri Yadi
 
OpenVR at Arduino Day Malmö
OpenVR at Arduino Day MalmöOpenVR at Arduino Day Malmö
OpenVR at Arduino Day MalmöAhmet YILDIRIM
 
Building Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureBuilding Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureNick Landry
 
Internet of things and arduino
Internet of things and arduinoInternet of things and arduino
Internet of things and arduinoChristophe Marchal
 

Tendances (20)

Development, debug and deploy hardware/software solutions based on Android an...
Development, debug and deploy hardware/software solutions based on Android an...Development, debug and deploy hardware/software solutions based on Android an...
Development, debug and deploy hardware/software solutions based on Android an...
 
Making arduino-talk-with-android-using-amarino
Making arduino-talk-with-android-using-amarinoMaking arduino-talk-with-android-using-amarino
Making arduino-talk-with-android-using-amarino
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory Protocol
 
Open hack 2011-hardware-hacks
Open hack 2011-hardware-hacksOpen hack 2011-hardware-hacks
Open hack 2011-hardware-hacks
 
Internet-of-Things with (Arduino+XBee)
Internet-of-Things with (Arduino+XBee)Internet-of-Things with (Arduino+XBee)
Internet-of-Things with (Arduino+XBee)
 
How to build your own Android devices @ Google Developer Day 2012
How to build your own Android devices @ Google Developer Day 2012How to build your own Android devices @ Google Developer Day 2012
How to build your own Android devices @ Google Developer Day 2012
 
Arduino Anatomy
Arduino AnatomyArduino Anatomy
Arduino Anatomy
 
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT CoreHands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
 
Introduction to Internet of Things Hardware
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things Hardware
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
 
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.jsRaspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
 
Confusion of Things — The IoT Hardware Kerfuffle
Confusion of Things — The IoT Hardware KerfuffleConfusion of Things — The IoT Hardware Kerfuffle
Confusion of Things — The IoT Hardware Kerfuffle
 
iPad Music Production iO Dock Product Overview
iPad Music Production iO Dock Product OverviewiPad Music Production iO Dock Product Overview
iPad Music Production iO Dock Product Overview
 
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCING
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCINGINTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCING
INTRODUCTION TO ARDUINO & RASPBERRY, SENSOR AND TEMPERATURE INTERAFCING
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
GDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoTGDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoT
 
OpenVR at Arduino Day Malmö
OpenVR at Arduino Day MalmöOpenVR at Arduino Day Malmö
OpenVR at Arduino Day Malmö
 
Building Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureBuilding Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & Azure
 
RD_M1_S
RD_M1_SRD_M1_S
RD_M1_S
 
Internet of things and arduino
Internet of things and arduinoInternet of things and arduino
Internet of things and arduino
 

En vedette

Casada Carmem
Casada CarmemCasada Carmem
Casada CarmemCapacete
 
Data transmission through Audio Jack on iOS
Data transmission through Audio Jack on iOSData transmission through Audio Jack on iOS
Data transmission through Audio Jack on iOSShipeng Xu
 
イチからはじめるADK北海道支部勉強会発表資料
イチからはじめるADK北海道支部勉強会発表資料イチからはじめるADK北海道支部勉強会発表資料
イチからはじめるADK北海道支部勉強会発表資料Kenichi Yoshida
 
Android アプリ開発における Gradle ビルドシステム
Android アプリ開発における Gradle ビルドシステムAndroid アプリ開発における Gradle ビルドシステム
Android アプリ開発における Gradle ビルドシステムYu Nobuoka
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIsPearl Chen
 
Navigation Using Audio Jack
Navigation Using Audio JackNavigation Using Audio Jack
Navigation Using Audio JackJayanta Ghoshal
 

En vedette (9)

Casada Carmem
Casada CarmemCasada Carmem
Casada Carmem
 
Data transmission through Audio Jack on iOS
Data transmission through Audio Jack on iOSData transmission through Audio Jack on iOS
Data transmission through Audio Jack on iOS
 
イチからはじめるADK北海道支部勉強会発表資料
イチからはじめるADK北海道支部勉強会発表資料イチからはじめるADK北海道支部勉強会発表資料
イチからはじめるADK北海道支部勉強会発表資料
 
Android アプリ開発における Gradle ビルドシステム
Android アプリ開発における Gradle ビルドシステムAndroid アプリ開発における Gradle ビルドシステム
Android アプリ開発における Gradle ビルドシステム
 
Android のusb support
Android のusb supportAndroid のusb support
Android のusb support
 
Presentacion ip
Presentacion ipPresentacion ip
Presentacion ip
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIs
 
Navigation Using Audio Jack
Navigation Using Audio JackNavigation Using Audio Jack
Navigation Using Audio Jack
 
Android usbの基本
Android usbの基本Android usbの基本
Android usbの基本
 

Similaire à Smartphone++

Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For BeginnersFTS seminar
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with androidfirenze-gtug
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitSulamita Garcia
 
Up and running with Arduino
Up and running with Arduino Up and running with Arduino
Up and running with Arduino KUET
 
Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxaartis110
 
Arduino Programming Software Development
Arduino Programming Software DevelopmentArduino Programming Software Development
Arduino Programming Software DevelopmentSanjay Kumar
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitIntel® Software
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la ActualidadLaurence HR
 
EclipseCon NA 2015 - Arduino designer : the making of!
EclipseCon NA 2015 - Arduino designer : the making of!EclipseCon NA 2015 - Arduino designer : the making of!
EclipseCon NA 2015 - Arduino designer : the making of!melbats
 
4 Introduction to Arduino.pdf
4 Introduction to Arduino.pdf4 Introduction to Arduino.pdf
4 Introduction to Arduino.pdfRynefelElopre2
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoRichard Rixham
 
IoT and developer chances
IoT and developer chancesIoT and developer chances
IoT and developer chancesChau Thanh
 
Cesec2015 - Arduino Designer
Cesec2015 - Arduino DesignerCesec2015 - Arduino Designer
Cesec2015 - Arduino Designermelbats
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptxAkshat Bijronia
 
Interoperability in Internet of Things (IOT)
Interoperability in Internet of Things (IOT)Interoperability in Internet of Things (IOT)
Interoperability in Internet of Things (IOT)manditalaskar123
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduinoMohamed Essam
 

Similaire à Smartphone++ (20)

Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For Beginners
 
An introduction to Arduino
An introduction to ArduinoAn introduction to Arduino
An introduction to Arduino
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with android
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Up and running with Arduino
Up and running with Arduino Up and running with Arduino
Up and running with Arduino
 
Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptx
 
Arduino Programming Software Development
Arduino Programming Software DevelopmentArduino Programming Software Development
Arduino Programming Software Development
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer Kit
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la Actualidad
 
EclipseCon NA 2015 - Arduino designer : the making of!
EclipseCon NA 2015 - Arduino designer : the making of!EclipseCon NA 2015 - Arduino designer : the making of!
EclipseCon NA 2015 - Arduino designer : the making of!
 
Arduino
ArduinoArduino
Arduino
 
Report on arduino
Report on arduinoReport on arduino
Report on arduino
 
4 Introduction to Arduino.pdf
4 Introduction to Arduino.pdf4 Introduction to Arduino.pdf
4 Introduction to Arduino.pdf
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
IoT and developer chances
IoT and developer chancesIoT and developer chances
IoT and developer chances
 
Cesec2015 - Arduino Designer
Cesec2015 - Arduino DesignerCesec2015 - Arduino Designer
Cesec2015 - Arduino Designer
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptx
 
Interoperability in Internet of Things (IOT)
Interoperability in Internet of Things (IOT)Interoperability in Internet of Things (IOT)
Interoperability in Internet of Things (IOT)
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Smartphone++

  • 1. Smartphone++ Marc Lester S. Tan Mobile Applications Developer, SAP GDG Devfest Kota Kinabalu 2013
  • 2. Agenda ●  Overview of Arduino ●  Google ADK ●  Uses of ADK and Demo
  • 4. Overview of Arduino •  Open-source electronics prototyping platform. •  Intended for Artists, Designers and Hobbyists. •  Arduino Programming Language based on Wiring. •  Arduino IDE based on Processing source: http://www.arduino.cc
  • 5. Overview of Arduino •  Inexpensive •  Cross-platform •  Simple and clear programming environment. •  Open-source software and hardware
  • 6. Arduino Shields Shields are boards that can be plugged on top of the Arduino PCB extending its capabilities. •  SD Card Shield •  USB Host Shield •  Ethernet Shield source: http://blog.protoneer.co.nz/
  • 7. Arduino IDE •  Java •  Based on Processing IDE (processing.org) •  Write and upload code to Arduino board
  • 8. Arduino Sketch •  setup() o  called once o  setup pin modes o  library initialization •  loop() o  called over the over again o  heart of every sketches
  • 9. Sample Sketch int inputPin = 12; // let pin 12 be our input pin int outputPin = 11; // let pin 11 be our ouput pin void setup(){ pinMode(outputPin, OUTPUT); // setup output pin to be an OUTPUT pinMode(inputPin, INPUT); // setup input pin to be our INPUT } void loop(){ int inputVal = digitalRead(inputPin); digitalWrite(outputPin, inputVal); delay(100); } // write the value of input pin to output // wait for 100ms // before looping again.
  • 11. USB on Android Host Mode Power Data Transfer Accessory Mode Power Data Transfer
  • 12. Google ADK ●  Reference implementation for hardware manufacturers and hobbyists. ●  It uses Android Open Accessory Protocol over USB or Bluetooth ●  The hardware is based on Arduino Mega. ●  Two versions: ADK 2011 and ADK 2012 source: http://www.engadget.com/gallery/googles-arduino-based-adk-hands-on-atgoogle-i-o-2011/
  • 13. Hello, Physical World •  Design and create the hardware or circuit. •  Write the firmware for your Arduino. •  Create an Android application that can talk to your firmware. source: http://www.youtube.com/watch?v=gcP7KwIENGw
  • 14. Design and Create the Hardware •  Use Fritzing to design your breadboard, schematic diagram and bill of materials. •  Get it from http://fritzing.org/
  • 15. Write the Firmware if (acc.isConnected()) { int len = acc.read(msg, sizeof(msg), 1); if(len > 0){ Serial.println(len); if(msg[0] == 0x1){ digitalWrite(13, HIGH); }else{ digitalWrite(13, LOW); } } }else{ digitalWrite(13, LOW); }
  • 16. Create the Android Application ●  USBManager - available since 3.1 but also available for 2.3.4 using Google API 10 ○  ●  Not all devices support accessory mode Android Manifest Requirements: Declare: <uses-feature android:name="android.hardware.usb.accessory" /> If using Add-on: <application….> <uses-library android:name="com.android.future.usb.accessory" />
  • 17. Create the Android Application Android Manifest Requirements: <activity ...> ... <intent-filter> <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" / > </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" android:resource="@xml/accessory_filter" /> </activity>
  • 18. Create the Android Application res/xml/accessory_filter.xml <?xml version="1.0" encoding="utf-8"?> <resources> <usb-accessory manufacturer="Marc Tan" model="Motor Control" version="1.0" /> </resources>
  • 19. Create the Android Application onCreate()... mUsbManager = UsbManager.getInstance(this); onResume()... UsbAccessory[] accessories = mUsbManager.getAccessoryList(); UsbAccessory accessory = accessories[0]); if (mUsbManager.hasPermission(accessory)) { openAccessory(accessory); }
  • 20. Create the Android Application protected void openAccessory(UsbAccessory accessory) { fileDescriptor = mUsbManager.openAccessory(accessory); FileDescriptor fd = fileDescriptor.getFileDescriptor(); input = new FileInputStream(fd); output = new FileOutputStream(fd); } onDestroy()... output.write(0); // optional fileDescriptor.close();
  • 21. Uses of ADK and Demo
  • 22. Uses of ADK Audio Docking Station
  • 25. Uses of ADK Home Automation
  • 28. Demo: Android as USB Host
  • 29. Resources Android ADK a.android.com Arduino and Electronics, Others arduino.cc tronixstuff.com hackaday.com My Blog and Github marctan.com github.com/mharkus Quadcopter bitcraze.se