SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Downloaden Sie, um offline zu lesen
Programming things with Android:
Home automation, Digital signage and Smart Object
using Android

Maurizio Caporali
Luca Pisani

www.udoo.org

Mobile&Embedded Firenze
Programming things?!?

Xerox
Alto

Douglas
Engelbart

www.udoo.org
Developers are changing
Programming Desktop
Computer
Programming Mobile Device
Xerox
Alto

Douglas
Engelbart

Programming Things
Prototyping Lab, FabLab, Hackathon
www.udoo.org
Computer Interaction is changing
Screen interaction

Xerox
Alto

Douglas
Engelbart

Interactive Things

www.udoo.org
www.udoo.org
Programming Things
It’s a complex
activity
Xerox
Alto

Douglas
Engelbart

Electronic Engineer, Mechanical Engineer, Computer
Engineer, ...
www.udoo.org
Programming Things: rapid prototyping tools

Arduino
*
Open Source
How to create the interaction
Open Source Software

Community
Xerox
Alto

Douglas
Engelbart

Linux

Android

www.udoo.org
Open Hardware
How to create Physical Mock Up quickly
Open Source Hardware

Community

Xerox
Alto

Douglas
Engelbart

Raspberry Pi
3D Printing
Arduino
www.udoo.org
Makers Revolution

Xerox
Alto

Communities

real!

Douglas
Engelbart

make this success
www.udoo.org
Arduino + Android: Android ADK

*
Applications
Ambient Devices
Home Automation
Smart Cities
Automotive
Urban Furniture
Digital Signage
Robot
*
What do you need?

+
Android Smartphone/Tablet

Arduino DUE

or

+
ARM single board computer

UDOO

Arduino DUE

www.udoo.org
What’s UDOO?
UDOO is a mini PC that could run either
Android or Linux, with an Arduinocompatible board embedded.
UDOO is a collective effort of a
multidisciplinary team spread between
North America and Europe, with expertise
in interaction design, embedded electronics
and sensor networks.
UDOO is a co-founded project by SECO
(www.seco.com) and Aidilab (www.aidilab.
com).
www.udoo.org
All-in-one solution
For the first time, a powerful ARM
cortex-A9 CPU for heavy tasks
with great performance, and a
dedicated ARM processor for the
GPIO are brought together in one
single board computer.

www.udoo.org
Arduino-compatible
UDOO is compatible with all the
sketches, tutorials and resources
available
on
the
Arduino
community as well as all the
shields, sensors and actuators for
Arduino DUE available on the
market.

www.udoo.org
Open Source and Community
UDOO is a proper open source
project where both hardware
designs and software are open
source.
Community development support
Schematics,
2D/3D
drawings,
Kernels and U-Boot sources are
available to the community in order
to improve and extend UDOO
capabilities and functionalities.
www.udoo.org
Power and flexibility for any kind of projects

www.udoo.org
www.udoo.org
Android on UDOO
Android 4.2.2 Jelly Beans runs
smoothly on UDOO giving you all
the features of an Android device.
Apps interface with Arduinocompatible
embedded
board
through Accessory Development
Kit (ADK) connection for building
accessories and smart devices
based on Android.
www.udoo.org
Android on UDOO
• Android Jelly Beans 4.2.2 AOSP
• up-to-date ASAP
• GAPPS could be installed: http://www.
udoo.org/guide-how-to-install-gappson-udoo-running-android/

www.udoo.org
Program Arduino App for UDOO
To program UDOO under Android we need the standard
tools:
● Eclipse + ADT plugin
● Android SDK Tools
● Android Platform-tools
We also need:
● Arduino IDE 1.5.4
● UDOO patch for Arduino IDE (bossac programmer)
www.udoo.org
UDOO Overview
● Android 4.2.2 runs on Freescale i.Mx6
(dual or quad core - 1 GB)
● UDOO is equipped with micro Atmel
SAM3X, the same of Arduino Due
● They are connected through bus USB
OTG
● We program the two CPUs separately
using Android SDK and Arduino IDE
www.udoo.org
UDOO Overview OTG - bus
● To allow the communication between Android and the SAM3X the
ADK protocol is needed. A set of libraries that authorize Android to
communicate with an external accessory.
● It's basically a bidirectional stream of data between the two parts
● Usually to communicate, install applications and debug the ADB
protocol is used through the USB OTG port on the android device.
● Also the microcontroller communicates using the OTG bus
www.udoo.org
UDOO Overview OTG - bus switch
The i.Mx6 processor can be connected with:
● the external USB port (debug app Android)
● the SAM3X microcontroller (usage)
It’s possible to switch via software between the 2 options

www.udoo.org
Programming Arduino
We need to program SAM3X microcontroller
with Arduino IDE downloadable from arduino.
cc
The Sketches have a standard structure, we
only need to add a library for OTG
communication.
We program the SAM3X through microUSB
serial port.

www.udoo.org
Programming Overview

www.udoo.org
AndroidManifest.xml
● Include a <uses-feature> element that declares that your
application uses the accessory feature.
<uses-feature android:name="android.hardware.usb.accessory" />

● Declare min(12) e target(17) SDK version
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="17" />

www.udoo.org
AndroidManifest.xml
● If you want your application to be notified of an attached USB
accessory, specify an <intent-filter> and<meta-data>
<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>

www.udoo.org
accessory_filter.xml
In the XML resource file, declare <usb-accessory> elements for the
accessories that you want to filter. Each<usb-accessory> can have
the following attributes:
● manufacturer
● model
● version
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-accessory manufacturer="Aidilab" model="UDOO_ADK" version="1.0" />
</resources>

www.udoo.org
Activity.java
The package you need to import is android.hardware.usb. This
contain the classes to support the accessory mode
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbManager;

Here is a summary of the relevant code for handling USB
connections:
mUSBManager = (UsbManager) getSystemService(Context.USB_SERVICE);
...
UsbAccessory acc = (UsbAccessory)intent.getParcelableExtra(UsbManager.
EXTRA_ACCESSORY);

www.udoo.org
Activity.java
To explicitly obtain permission, first create a broadcast receiver. This receiver
listens for the intent that gets broadcast when you call requestPermission(). The call
to requestPermission() displays a dialog to the user asking for permission to connect
to the accessory
private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (ACTION_USB_PERMISSION.equals(action)) {
synchronized (this) {
UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
if (intent.getBooleanExtra(
UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
openAccessory(accessory);
} else {
Log.d(TAG, "permission denied for accessory "+ accessory);
}
mPermissionRequestPending = false;
}
}

www.udoo.org
Activity.java
To register the broadcast receiver, put this in your onCreate()
method in your activity:
mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent
(ACTION_USB_PERMISSION), 0);
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
registerReceiver(mUsbReceiver, filter);

To display the dialog that asks users for permission to connect to the
accessory, call the requestPermission() method:
mUsbManager.requestPermission(accessory,mPermissionIntent);
www.udoo.org
Activity.java
To communicate with the accessory you need a file descriptor to set
up input and output streams to read and write data:
private void openAccessory(UsbAccessory accessory) {
mFileDescriptor = mUsbManager.openAccessory(accessory);
if (mFileDescriptor != null) {
mAccessory = accessory;
FileDescriptor fd = mFileDescriptor.getFileDescriptor();
mInputStream = new FileInputStream(fd);
mOutputStream = new FileOutputStream(fd);
}
}
www.udoo.org
Activity.java
We use the output and input stream to send and receive messages to
the Arduino processors of UDOO.
byte[] message = new byte[1];
message[0] = (byte)1;
mOutputStream.write(message);
...
byte[] buffer = new byte[4];
running = true;
ret = mInputStream.read(buffer);
www.udoo.org
Programming Arduino
To program SAM3X we need to download Arduino IDE based on
Processing project.
Arduino programming language is based on C / C++ with specific
objects that provides main arduino’s functions.
It provides an interface with the microcontroller low level C
programming language.
It allows to avoid “unfriendly” low level difficulties (write or read
registers, manage signals timings, non objects).
www.udoo.org
Programming Arduino
Arduino sketches have a defined structure based on two main
functions:
- void setup()
- void loop()
Setup method is executed at the beginning of the sketch, and it’s
used to initialize objects.
Loop method is executed continuously after first setup execution. It
contains the core of the code.
www.udoo.org
Programming Arduino
Example for blinkin LED:
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
// wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000);
// wait for a second
}
www.udoo.org
Arduino .ino
The accessory code must make a few calls to initialize USB
connectivity, including setting the accessory identification strings:
char descriptionName[] = "UDOOAndroidADKDemo";
char modelName[] = "UDOO_ADK";
char manufacturerName[] = "Aidilab";
char versionNumber[] = "1.0";
char serialNumber[] = "1";
char url[] = "http://www.udoo.org";
USBHost Usb;
ADK adk(&Usb, manufacturerName, modelName, descriptionName, versionNumber, url,
serialNumber);
www.udoo.org
Arduino .ino
read data from Android App into buffer:
void loop(){
uint8_t bufRead[BUFSIZE];
uint32_t nbread = 0;
uint8_t bufWrite[1];
if (adk.isReady()) {
adk.read(&nbread, BUFSIZE, buf); // read data into buf array
if (nbread > 0) {
... // do stuff

www.udoo.org
Arduino .ino

write data to Android App:
void loop(){
uint8_t bufWrite[BUFSIZE];
...
...
adk.write(sizeof(bufWrite), (uint8_t *)bufWrite);

www.udoo.org
Android ADK useful links
● Android ADK Documentation
http://developer.android.
com/guide/topics/connectivity/usb/accessory.html
http://developer.android.com/tools/adk/adk2.html
● Toolkit to help beginners to be up and running with ADK 2012:
https://github.com/palazzem/adk-toolkit
by Emanuele Palazzetti (GDG Perugia)
www.udoo.org
Arduino Resources & Community
Downloads:
http://arduino.cc/en/Main/Software
http://www.udoo.org/downloads/
Resources:
http://arduino.cc/en/Tutorial/HomePage
http://arduino.cc/en/Reference/HomePage
Community:
http://forum.arduino.cc/
more… more.. and more
www.udoo.org
Projects

www.udoo.org
Community: www.udoo.org
• Informative

website

• Forum
• Tutorials
• Projects
• Wiki
• Support
• Faq
www.udoo.org

Weitere ähnliche Inhalte

Was ist angesagt?

Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDKIntel® Software
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingSoftware Guru
 
Mobile development
Mobile developmentMobile development
Mobile developmentSayed Ahmed
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop PresentationHem Shrestha
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017 Stefano Sanna
 
Mobile development
Mobile developmentMobile development
Mobile developmentSayed Ahmed
 
Windows 10 IoT Core on Raspberry Pi 2 Usine IO
Windows 10 IoT Core on Raspberry Pi 2 Usine IOWindows 10 IoT Core on Raspberry Pi 2 Usine IO
Windows 10 IoT Core on Raspberry Pi 2 Usine IOAlex Danvy
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
Make manual testing to automated by Sikuli bug daybkk2013
Make manual testing to automated by Sikuli bug daybkk2013Make manual testing to automated by Sikuli bug daybkk2013
Make manual testing to automated by Sikuli bug daybkk2013Tumit Watcharapol
 
Dload mobile development
Dload mobile developmentDload mobile development
Dload mobile developmentSayed Ahmed
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIsPearl Chen
 
Customize and control connected devices
Customize and control connected devicesCustomize and control connected devices
Customize and control connected devicesCodemotion
 
Android Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKAndroid Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKRajesh Sola
 
Project presentation (Loginradius SDK for Android)
Project presentation (Loginradius SDK for Android)Project presentation (Loginradius SDK for Android)
Project presentation (Loginradius SDK for Android)shwetarathi Rathi
 

Was ist angesagt? (20)

Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & Testing
 
Ci for Android
Ci for AndroidCi for Android
Ci for Android
 
Mobile development
Mobile developmentMobile development
Mobile development
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop Presentation
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017
 
Mobile development
Mobile developmentMobile development
Mobile development
 
Windows 10 IoT Core on Raspberry Pi 2 Usine IO
Windows 10 IoT Core on Raspberry Pi 2 Usine IOWindows 10 IoT Core on Raspberry Pi 2 Usine IO
Windows 10 IoT Core on Raspberry Pi 2 Usine IO
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
Make manual testing to automated by Sikuli bug daybkk2013
Make manual testing to automated by Sikuli bug daybkk2013Make manual testing to automated by Sikuli bug daybkk2013
Make manual testing to automated by Sikuli bug daybkk2013
 
Dload mobile development
Dload mobile developmentDload mobile development
Dload mobile development
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIs
 
Customize and control connected devices
Customize and control connected devicesCustomize and control connected devices
Customize and control connected devices
 
Android Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKAndroid Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADK
 
Flutter 1
Flutter 1Flutter 1
Flutter 1
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Sikuli
SikuliSikuli
Sikuli
 
Project presentation (Loginradius SDK for Android)
Project presentation (Loginradius SDK for Android)Project presentation (Loginradius SDK for Android)
Project presentation (Loginradius SDK for Android)
 

Andere mochten auch

Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objectsjulien pauli
 
Visual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezlyVisual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezlyPrezly
 
10 commandments for better android development
10 commandments for better android development10 commandments for better android development
10 commandments for better android developmentTrey Robinson
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHPGuilherme Blanco
 
We Built It, And They Didn't Come!
We Built It, And They Didn't Come!We Built It, And They Didn't Come!
We Built It, And They Didn't Come!Lukas Fittl
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix itRafael Dohms
 
Kicking the Bukkit: Anatomy of an open source meltdown
Kicking the Bukkit: Anatomy of an open source meltdownKicking the Bukkit: Anatomy of an open source meltdown
Kicking the Bukkit: Anatomy of an open source meltdownRyanMichela
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHPRafael Dohms
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projectsIgnacio Martín
 
Enterprise PHP: mappers, models and services
Enterprise PHP: mappers, models and servicesEnterprise PHP: mappers, models and services
Enterprise PHP: mappers, models and servicesAaron Saray
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Aaron Saray
 
Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Scott Wlaschin
 
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyFrom Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyChris Johnson
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 

Andere mochten auch (18)

Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
 
Visual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezlyVisual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezly
 
10 commandments for better android development
10 commandments for better android development10 commandments for better android development
10 commandments for better android development
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHP
 
We Built It, And They Didn't Come!
We Built It, And They Didn't Come!We Built It, And They Didn't Come!
We Built It, And They Didn't Come!
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
Kicking the Bukkit: Anatomy of an open source meltdown
Kicking the Bukkit: Anatomy of an open source meltdownKicking the Bukkit: Anatomy of an open source meltdown
Kicking the Bukkit: Anatomy of an open source meltdown
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHP
 
Clean code
Clean codeClean code
Clean code
 
How to Design Indexes, Really
How to Design Indexes, ReallyHow to Design Indexes, Really
How to Design Indexes, Really
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
 
Enterprise PHP: mappers, models and services
Enterprise PHP: mappers, models and servicesEnterprise PHP: mappers, models and services
Enterprise PHP: mappers, models and services
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
 
Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)
 
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyFrom Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover Weekly
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 

Ähnlich wie 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!Codemotion
 
Smartphone++
Smartphone++Smartphone++
Smartphone++mharkus
 
Better With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoBetter With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoPearl Chen
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easyLars Vogel
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsPositive Hack Days
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from AnywhereIRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from AnywhereIRJET Journal
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET-  	  IOT Dune Buggy –Control it from AnywhereIRJET-  	  IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from AnywhereIRJET Journal
 
.Net Gadgeteer
.Net Gadgeteer .Net Gadgeteer
.Net Gadgeteer Wade Zhu
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopKasun Dananjaya Delgolla
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Lars Vogel
 
Android Internals and Toolchain
Android Internals and ToolchainAndroid Internals and Toolchain
Android Internals and ToolchainVladimir Kotov
 
arduino 320126512170.pptx
arduino 320126512170.pptxarduino 320126512170.pptx
arduino 320126512170.pptxpriyaanaparthy
 
aoa-adk-osidays-rajeshsola
aoa-adk-osidays-rajeshsolaaoa-adk-osidays-rajeshsola
aoa-adk-osidays-rajeshsolaRajesh Sola
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusainstudent
 
Hack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSHack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSDevFest DC
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.pptBijayKc16
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game developmentWomen In Digital
 

Ähnlich wie Programming objects with android (20)

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!
 
Smartphone++
Smartphone++Smartphone++
Smartphone++
 
Better With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoBetter With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+Arduino
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easy
 
Arduino
ArduinoArduino
Arduino
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from AnywhereIRJET- IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from Anywhere
 
IRJET- IOT Dune Buggy –Control it from Anywhere
IRJET-  	  IOT Dune Buggy –Control it from AnywhereIRJET-  	  IOT Dune Buggy –Control it from Anywhere
IRJET- IOT Dune Buggy –Control it from Anywhere
 
.Net Gadgeteer
.Net Gadgeteer .Net Gadgeteer
.Net Gadgeteer
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Android Things - The IoT platform for everyone.
Android Things - The IoT platform for everyone. Android Things - The IoT platform for everyone.
Android Things - The IoT platform for everyone.
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Android Internals and Toolchain
Android Internals and ToolchainAndroid Internals and Toolchain
Android Internals and Toolchain
 
arduino 320126512170.pptx
arduino 320126512170.pptxarduino 320126512170.pptx
arduino 320126512170.pptx
 
aoa-adk-osidays-rajeshsola
aoa-adk-osidays-rajeshsolaaoa-adk-osidays-rajeshsola
aoa-adk-osidays-rajeshsola
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Hack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSHack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGS
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.ppt
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Usb Drive Protector
Usb Drive ProtectorUsb Drive Protector
Usb Drive Protector
 

Mehr von firenze-gtug

Html5 apps - GWT oriented
Html5 apps - GWT orientedHtml5 apps - GWT oriented
Html5 apps - GWT orientedfirenze-gtug
 
Android ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi IntelAndroid ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi Intelfirenze-gtug
 
Gwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca TosiGwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca Tosifirenze-gtug
 
Youtube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'AmbrosioYoutube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'Ambrosiofirenze-gtug
 
Intro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'AmbrosioIntro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'Ambrosiofirenze-gtug
 
Arduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'AmbrosioArduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'Ambrosiofirenze-gtug
 
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo BugianiIntroduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugianifirenze-gtug
 
RFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano ColucciniRFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano Coluccinifirenze-gtug
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)firenze-gtug
 
Presentazione Google App Engine
Presentazione Google App EnginePresentazione Google App Engine
Presentazione Google App Enginefirenze-gtug
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloudfirenze-gtug
 
Clean android code
Clean android codeClean android code
Clean android codefirenze-gtug
 
EE Incremental Store
EE Incremental StoreEE Incremental Store
EE Incremental Storefirenze-gtug
 
Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014firenze-gtug
 
Maven from dummies
Maven from dummiesMaven from dummies
Maven from dummiesfirenze-gtug
 
Dev fest android application case study
Dev fest android application   case studyDev fest android application   case study
Dev fest android application case studyfirenze-gtug
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdkfirenze-gtug
 
You tube api overview
You tube api overviewYou tube api overview
You tube api overviewfirenze-gtug
 

Mehr von firenze-gtug (20)

Html5 apps - GWT oriented
Html5 apps - GWT orientedHtml5 apps - GWT oriented
Html5 apps - GWT oriented
 
Android ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi IntelAndroid ndk - ottimizzazione su dispositivi Intel
Android ndk - ottimizzazione su dispositivi Intel
 
Gwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca TosiGwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca Tosi
 
Youtube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'AmbrosioYoutube broadcast live - Massimiliano D'Ambrosio
Youtube broadcast live - Massimiliano D'Ambrosio
 
Intro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'AmbrosioIntro BeagleBone Black - Massimiliano D'Ambrosio
Intro BeagleBone Black - Massimiliano D'Ambrosio
 
Arduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'AmbrosioArduino - Massimiliano D'Ambrosio
Arduino - Massimiliano D'Ambrosio
 
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo BugianiIntroduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
Introduzione a GAE - Alessandro Aglietti e Lorenzo Bugiani
 
RFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano ColucciniRFID: What & Why - Stefano Coluccini
RFID: What & Why - Stefano Coluccini
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 
Presentazione Google App Engine
Presentazione Google App EnginePresentazione Google App Engine
Presentazione Google App Engine
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Clean android code
Clean android codeClean android code
Clean android code
 
#Html2Native
#Html2Native#Html2Native
#Html2Native
 
EE Incremental Store
EE Incremental StoreEE Incremental Store
EE Incremental Store
 
Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014Apertura "Mobile & Embedded" - 13 febbraio 2014
Apertura "Mobile & Embedded" - 13 febbraio 2014
 
Maven from dummies
Maven from dummiesMaven from dummies
Maven from dummies
 
Apps fuel oct2012
Apps fuel oct2012Apps fuel oct2012
Apps fuel oct2012
 
Dev fest android application case study
Dev fest android application   case studyDev fest android application   case study
Dev fest android application case study
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
 
You tube api overview
You tube api overviewYou tube api overview
You tube api overview
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Programming objects with android

  • 1. Programming things with Android: Home automation, Digital signage and Smart Object using Android Maurizio Caporali Luca Pisani www.udoo.org Mobile&Embedded Firenze
  • 3. Developers are changing Programming Desktop Computer Programming Mobile Device Xerox Alto Douglas Engelbart Programming Things Prototyping Lab, FabLab, Hackathon www.udoo.org
  • 4. Computer Interaction is changing Screen interaction Xerox Alto Douglas Engelbart Interactive Things www.udoo.org
  • 6. Programming Things It’s a complex activity Xerox Alto Douglas Engelbart Electronic Engineer, Mechanical Engineer, Computer Engineer, ... www.udoo.org
  • 7. Programming Things: rapid prototyping tools Arduino *
  • 8. Open Source How to create the interaction Open Source Software Community Xerox Alto Douglas Engelbart Linux Android www.udoo.org
  • 9. Open Hardware How to create Physical Mock Up quickly Open Source Hardware Community Xerox Alto Douglas Engelbart Raspberry Pi 3D Printing Arduino www.udoo.org
  • 11. Arduino + Android: Android ADK *
  • 12. Applications Ambient Devices Home Automation Smart Cities Automotive Urban Furniture Digital Signage Robot *
  • 13. What do you need? + Android Smartphone/Tablet Arduino DUE or + ARM single board computer UDOO Arduino DUE www.udoo.org
  • 14. What’s UDOO? UDOO is a mini PC that could run either Android or Linux, with an Arduinocompatible board embedded. UDOO is a collective effort of a multidisciplinary team spread between North America and Europe, with expertise in interaction design, embedded electronics and sensor networks. UDOO is a co-founded project by SECO (www.seco.com) and Aidilab (www.aidilab. com). www.udoo.org
  • 15. All-in-one solution For the first time, a powerful ARM cortex-A9 CPU for heavy tasks with great performance, and a dedicated ARM processor for the GPIO are brought together in one single board computer. www.udoo.org
  • 16. Arduino-compatible UDOO is compatible with all the sketches, tutorials and resources available on the Arduino community as well as all the shields, sensors and actuators for Arduino DUE available on the market. www.udoo.org
  • 17. Open Source and Community UDOO is a proper open source project where both hardware designs and software are open source. Community development support Schematics, 2D/3D drawings, Kernels and U-Boot sources are available to the community in order to improve and extend UDOO capabilities and functionalities. www.udoo.org
  • 18. Power and flexibility for any kind of projects www.udoo.org
  • 20. Android on UDOO Android 4.2.2 Jelly Beans runs smoothly on UDOO giving you all the features of an Android device. Apps interface with Arduinocompatible embedded board through Accessory Development Kit (ADK) connection for building accessories and smart devices based on Android. www.udoo.org
  • 21. Android on UDOO • Android Jelly Beans 4.2.2 AOSP • up-to-date ASAP • GAPPS could be installed: http://www. udoo.org/guide-how-to-install-gappson-udoo-running-android/ www.udoo.org
  • 22. Program Arduino App for UDOO To program UDOO under Android we need the standard tools: ● Eclipse + ADT plugin ● Android SDK Tools ● Android Platform-tools We also need: ● Arduino IDE 1.5.4 ● UDOO patch for Arduino IDE (bossac programmer) www.udoo.org
  • 23. UDOO Overview ● Android 4.2.2 runs on Freescale i.Mx6 (dual or quad core - 1 GB) ● UDOO is equipped with micro Atmel SAM3X, the same of Arduino Due ● They are connected through bus USB OTG ● We program the two CPUs separately using Android SDK and Arduino IDE www.udoo.org
  • 24. UDOO Overview OTG - bus ● To allow the communication between Android and the SAM3X the ADK protocol is needed. A set of libraries that authorize Android to communicate with an external accessory. ● It's basically a bidirectional stream of data between the two parts ● Usually to communicate, install applications and debug the ADB protocol is used through the USB OTG port on the android device. ● Also the microcontroller communicates using the OTG bus www.udoo.org
  • 25. UDOO Overview OTG - bus switch The i.Mx6 processor can be connected with: ● the external USB port (debug app Android) ● the SAM3X microcontroller (usage) It’s possible to switch via software between the 2 options www.udoo.org
  • 26. Programming Arduino We need to program SAM3X microcontroller with Arduino IDE downloadable from arduino. cc The Sketches have a standard structure, we only need to add a library for OTG communication. We program the SAM3X through microUSB serial port. www.udoo.org
  • 28. AndroidManifest.xml ● Include a <uses-feature> element that declares that your application uses the accessory feature. <uses-feature android:name="android.hardware.usb.accessory" /> ● Declare min(12) e target(17) SDK version <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="17" /> www.udoo.org
  • 29. AndroidManifest.xml ● If you want your application to be notified of an attached USB accessory, specify an <intent-filter> and<meta-data> <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> www.udoo.org
  • 30. accessory_filter.xml In the XML resource file, declare <usb-accessory> elements for the accessories that you want to filter. Each<usb-accessory> can have the following attributes: ● manufacturer ● model ● version <?xml version="1.0" encoding="utf-8"?> <resources> <usb-accessory manufacturer="Aidilab" model="UDOO_ADK" version="1.0" /> </resources> www.udoo.org
  • 31. Activity.java The package you need to import is android.hardware.usb. This contain the classes to support the accessory mode import android.hardware.usb.UsbAccessory; import android.hardware.usb.UsbManager; Here is a summary of the relevant code for handling USB connections: mUSBManager = (UsbManager) getSystemService(Context.USB_SERVICE); ... UsbAccessory acc = (UsbAccessory)intent.getParcelableExtra(UsbManager. EXTRA_ACCESSORY); www.udoo.org
  • 32. Activity.java To explicitly obtain permission, first create a broadcast receiver. This receiver listens for the intent that gets broadcast when you call requestPermission(). The call to requestPermission() displays a dialog to the user asking for permission to connect to the accessory private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (ACTION_USB_PERMISSION.equals(action)) { synchronized (this) { UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); if (intent.getBooleanExtra( UsbManager.EXTRA_PERMISSION_GRANTED, false)) { openAccessory(accessory); } else { Log.d(TAG, "permission denied for accessory "+ accessory); } mPermissionRequestPending = false; } } www.udoo.org
  • 33. Activity.java To register the broadcast receiver, put this in your onCreate() method in your activity: mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent (ACTION_USB_PERMISSION), 0); IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION); registerReceiver(mUsbReceiver, filter); To display the dialog that asks users for permission to connect to the accessory, call the requestPermission() method: mUsbManager.requestPermission(accessory,mPermissionIntent); www.udoo.org
  • 34. Activity.java To communicate with the accessory you need a file descriptor to set up input and output streams to read and write data: private void openAccessory(UsbAccessory accessory) { mFileDescriptor = mUsbManager.openAccessory(accessory); if (mFileDescriptor != null) { mAccessory = accessory; FileDescriptor fd = mFileDescriptor.getFileDescriptor(); mInputStream = new FileInputStream(fd); mOutputStream = new FileOutputStream(fd); } } www.udoo.org
  • 35. Activity.java We use the output and input stream to send and receive messages to the Arduino processors of UDOO. byte[] message = new byte[1]; message[0] = (byte)1; mOutputStream.write(message); ... byte[] buffer = new byte[4]; running = true; ret = mInputStream.read(buffer); www.udoo.org
  • 36. Programming Arduino To program SAM3X we need to download Arduino IDE based on Processing project. Arduino programming language is based on C / C++ with specific objects that provides main arduino’s functions. It provides an interface with the microcontroller low level C programming language. It allows to avoid “unfriendly” low level difficulties (write or read registers, manage signals timings, non objects). www.udoo.org
  • 37. Programming Arduino Arduino sketches have a defined structure based on two main functions: - void setup() - void loop() Setup method is executed at the beginning of the sketch, and it’s used to initialize objects. Loop method is executed continuously after first setup execution. It contains the core of the code. www.udoo.org
  • 38. Programming Arduino Example for blinkin LED: int led = 13; void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } www.udoo.org
  • 39. Arduino .ino The accessory code must make a few calls to initialize USB connectivity, including setting the accessory identification strings: char descriptionName[] = "UDOOAndroidADKDemo"; char modelName[] = "UDOO_ADK"; char manufacturerName[] = "Aidilab"; char versionNumber[] = "1.0"; char serialNumber[] = "1"; char url[] = "http://www.udoo.org"; USBHost Usb; ADK adk(&Usb, manufacturerName, modelName, descriptionName, versionNumber, url, serialNumber); www.udoo.org
  • 40. Arduino .ino read data from Android App into buffer: void loop(){ uint8_t bufRead[BUFSIZE]; uint32_t nbread = 0; uint8_t bufWrite[1]; if (adk.isReady()) { adk.read(&nbread, BUFSIZE, buf); // read data into buf array if (nbread > 0) { ... // do stuff www.udoo.org
  • 41. Arduino .ino write data to Android App: void loop(){ uint8_t bufWrite[BUFSIZE]; ... ... adk.write(sizeof(bufWrite), (uint8_t *)bufWrite); www.udoo.org
  • 42. Android ADK useful links ● Android ADK Documentation http://developer.android. com/guide/topics/connectivity/usb/accessory.html http://developer.android.com/tools/adk/adk2.html ● Toolkit to help beginners to be up and running with ADK 2012: https://github.com/palazzem/adk-toolkit by Emanuele Palazzetti (GDG Perugia) www.udoo.org
  • 43. Arduino Resources & Community Downloads: http://arduino.cc/en/Main/Software http://www.udoo.org/downloads/ Resources: http://arduino.cc/en/Tutorial/HomePage http://arduino.cc/en/Reference/HomePage Community: http://forum.arduino.cc/ more… more.. and more www.udoo.org
  • 45. Community: www.udoo.org • Informative website • Forum • Tutorials • Projects • Wiki • Support • Faq www.udoo.org