This document summarizes a presentation about integrating external hardware with Android devices. It discusses Android Open Accessory (AOA) for connecting Arduino boards and other devices to Android via USB. It provides examples of AOA firmware and code. It also covers using Near Field Communication (NFC) and Bluetooth to enable interactions between Android devices and NFC tags or other Bluetooth devices. The presentation provides use cases and project ideas for combining Android with hardware inputs/outputs.
Learn Evothings Studio along with ESP8266Hammad Tariq
The presentation is designed for anyone who want to self-learn Evothings Studio - a mobile app prototyping tool for IoT devices! The presentation also includes step-by-step tutorial to connect and control ESP8266 WiFi module with your iOS/Android mobile app.
Arduino takes role on electronics system development. On this talk we will share about our work on making digital car dashboard using Arduino and Android.
Lab Handson: Power your Creations with Intel Edison!Codemotion
by Francesco Baldassarri - Come along and play with Intel Edison, for the Internet of Things? Learn about the Developer Kit for IoT, chose your preferred environment and test it – or test all the possibilities? We will be providing information and hands on training for developers interested in testing our solutions in C/C++, Javascript, Arduino, Wyliodrin and Python. Just bring you laptop and we will help you to get started. We will also provide information about our Cloud Analytics platform, and test hardware samples with the Grove Starter Kit – Intel IoT Edition. Visit us anytime and start making! What will you make?
Android Things - The IoT platform from GoogleEmmanuel Obot
Android Things - The IoT platform from Google, it's easy to learn.
Follow the presentation and learn.
With Android things base project to remotely control appliances and monitor or get alert of an intruder via mobile phone.
Learn Evothings Studio along with ESP8266Hammad Tariq
The presentation is designed for anyone who want to self-learn Evothings Studio - a mobile app prototyping tool for IoT devices! The presentation also includes step-by-step tutorial to connect and control ESP8266 WiFi module with your iOS/Android mobile app.
Arduino takes role on electronics system development. On this talk we will share about our work on making digital car dashboard using Arduino and Android.
Lab Handson: Power your Creations with Intel Edison!Codemotion
by Francesco Baldassarri - Come along and play with Intel Edison, for the Internet of Things? Learn about the Developer Kit for IoT, chose your preferred environment and test it – or test all the possibilities? We will be providing information and hands on training for developers interested in testing our solutions in C/C++, Javascript, Arduino, Wyliodrin and Python. Just bring you laptop and we will help you to get started. We will also provide information about our Cloud Analytics platform, and test hardware samples with the Grove Starter Kit – Intel IoT Edition. Visit us anytime and start making! What will you make?
Android Things - The IoT platform from GoogleEmmanuel Obot
Android Things - The IoT platform from Google, it's easy to learn.
Follow the presentation and learn.
With Android things base project to remotely control appliances and monitor or get alert of an intruder via mobile phone.
Presented at Devconf South Africa by Rebecca Franks, Android Engineering Lead at DVT
Android Things :
In this presentation, Rebecca will cover the new platform recently announced by Google, called Android Things. She will cover an introduction to Android Things, basics of getting started with the platform and how any developer without electronics experience can build IoT apps with Android Things. A few use cases and examples will be shown in this session, along with how you can use the existing android libraries with your next IoT project.
Rebecca is the Android Engineering Lead at DVT based in Johannesburg, South Africa. She loves working with new technology and has a passion for making great user friendly products. In her spare time, she manages her open source app, Book Dash, which contains free African story books. She speaks at conferences and local meetups mainly about Android. When not coding, she can be found baking and travelling the world.
More about Rebecca:
Previous talks : https://riggaroo.co.za/talks/
Blogging over at https://riggaroo.co.za Twitter: https://twitter.com/riggaroo From Johannesburg, South Africa. Love Baking and Android Development.
Creating mobile apps with Cordova for iOS, Android and BlackBerry 10Demian Borba
Understand everything that is needed to create cross platform mobile applications using Cordova for iOS, Android and BlackBerry 10. We will go through all the steps for configuring your machine (Mac or Windows), as well as add Cordova and WebWorks plugins. We will see how to package, deploy and debug hybrid apps on BlackBerry 10 and Android devices. In the end, we will inspect the project phonegapbootcamp.io, an open source website/mobileapp built with Angular, Gulp and Cordova.
Android workshop to prepare for 48hacks (http://www.ntuventures.com/events/48hacks/index.html), organized by NTU Venture.
Covers basic Android application programming, and connectivity to Arduino board via Bluetooth.
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016Benjamin Cabé
Video available at: https://www.youtube.com/watch?v=P8Hk5Ir8fXo
Samsung has introduced the Samsung ARTIK IDE for IoT Developers. This new set of tools is based on Eclipse Che and is designed to make it easy to build, deploy and manage IoT applications. This presentation will demonstrate why creating the right tools for IoT developers make it quicker and easier for IoT application development.
Getting started with android dev and test perspectiveGunjan Kumar
The presentation covers basic intro to Android, how to get started with development, including instructions on setup, common UI usages like menus, dialogs; details on services like Sensors, Location and Google Maps
It also covers ideas on how to test including details on shell and installation instructions without using Eclipse
Presentation on Microsoft Technologies in Teaching, Learning and Research presented at Microsoft IT Academy Summit 2011 October. - Presentation Video in low quality to allow upload
Building Better IoT Applications without ServersIan Massingham
This deck introduces the benefits of using a the AWS Cloud to build Connected Device/IoT Applications without running virtual machines or other high-maintenance service components.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
More Related Content
Similar to Better With Friends: Android+NFC+Arduino
Presented at Devconf South Africa by Rebecca Franks, Android Engineering Lead at DVT
Android Things :
In this presentation, Rebecca will cover the new platform recently announced by Google, called Android Things. She will cover an introduction to Android Things, basics of getting started with the platform and how any developer without electronics experience can build IoT apps with Android Things. A few use cases and examples will be shown in this session, along with how you can use the existing android libraries with your next IoT project.
Rebecca is the Android Engineering Lead at DVT based in Johannesburg, South Africa. She loves working with new technology and has a passion for making great user friendly products. In her spare time, she manages her open source app, Book Dash, which contains free African story books. She speaks at conferences and local meetups mainly about Android. When not coding, she can be found baking and travelling the world.
More about Rebecca:
Previous talks : https://riggaroo.co.za/talks/
Blogging over at https://riggaroo.co.za Twitter: https://twitter.com/riggaroo From Johannesburg, South Africa. Love Baking and Android Development.
Creating mobile apps with Cordova for iOS, Android and BlackBerry 10Demian Borba
Understand everything that is needed to create cross platform mobile applications using Cordova for iOS, Android and BlackBerry 10. We will go through all the steps for configuring your machine (Mac or Windows), as well as add Cordova and WebWorks plugins. We will see how to package, deploy and debug hybrid apps on BlackBerry 10 and Android devices. In the end, we will inspect the project phonegapbootcamp.io, an open source website/mobileapp built with Angular, Gulp and Cordova.
Android workshop to prepare for 48hacks (http://www.ntuventures.com/events/48hacks/index.html), organized by NTU Venture.
Covers basic Android application programming, and connectivity to Arduino board via Bluetooth.
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016Benjamin Cabé
Video available at: https://www.youtube.com/watch?v=P8Hk5Ir8fXo
Samsung has introduced the Samsung ARTIK IDE for IoT Developers. This new set of tools is based on Eclipse Che and is designed to make it easy to build, deploy and manage IoT applications. This presentation will demonstrate why creating the right tools for IoT developers make it quicker and easier for IoT application development.
Getting started with android dev and test perspectiveGunjan Kumar
The presentation covers basic intro to Android, how to get started with development, including instructions on setup, common UI usages like menus, dialogs; details on services like Sensors, Location and Google Maps
It also covers ideas on how to test including details on shell and installation instructions without using Eclipse
Presentation on Microsoft Technologies in Teaching, Learning and Research presented at Microsoft IT Academy Summit 2011 October. - Presentation Video in low quality to allow upload
Building Better IoT Applications without ServersIan Massingham
This deck introduces the benefits of using a the AWS Cloud to build Connected Device/IoT Applications without running virtual machines or other high-maintenance service components.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
How world-class product teams are winning in the AI era by CEO and Founder, P...
Better With Friends: Android+NFC+Arduino
1. NFC Bluetooth
Open
Accessory
Better with Friends
(Or "Android: The Loveable Mobile Platform That Plays Well with External Devices")
Pearl Chen Google+: klab.ca/+
pearl@karma-laboratory.com Twitter: @PearlChen
klab.ca/spotlightandroid
2. The future is already here
— it's just not very evenly
distributed.
William Gibson
klab.ca/spotlightandroid
3. About me
Some Comp Sci classes back there too
( Illustration created using modified output from visualize.me and my LinkedIn profile. )
7. The Third Industrial Revolution
From The Economist, April 2012
A number of remarkable technologies are converging: clever software,
novel materials, more dexterous robots, new processes (notably 3D
printing) and a whole range of web-based services. The factory of the
past was based on cranking out zillions of identical products.
The factory of the future will focus on mass customisation.
9. Hardware startups becoming viable
Pebble Kickstarter campaign as of June 2012
[The founder] also shared a photo of the
first Pebble prototype using an Arduino and
some similarly cobbled-together hardware.
That was four years ago.
via Slashgear
10. Looking at the hardware trends
• Small, yet mighty
• Multi-screen
• Always on
• $$$ ⇾ $
Project Glass by Google
Steve Mann - world’s first cyborg
12. And how is this related to Android?
This talk will cover:
• External hardware integration
with Android Open Accessory
• NFC for low-friction interactions
(not related to mobile payments)
• Combining with Bluetooth
13. Professional Android Sensor Programming
Disclaimer: I authored chapter 11 (NFC)
& co-authored 10 (AOA)
(more info here)
klab.ca/spotlightandroid
17. More Android Development Kits!
SparkFun IOIO
Microchip PIC24F ADK
ODroid ADK
klab.ca/spotlightandroid
18. Basic firmware/sketch on Arduino ADK
Note: You can get a fully working but barebones Arduino ADK sketch here: iheartrobotics.com/2011/07/arduino-mega-adk-setup-notes.html
#include <Max3421e.h>
USB and USB host libraries
#include <Usb.h>
#include <AndroidAccessory.h> Google-supplied C++ library
Create a new instance of the AndroidAccessory
AndroidAccessory acc("Manufacturer", "Model",
"Description", "1.0",
"http://www.android.com",
"0000000012345678");
void setup() {
Convenience method that simply calls the
acc.powerOn(); powerOn() method in the Max3421e library.
}
void loop() {
byte msg[0]; Continually check for connection to Android app
if (acc.isConnected()) {
//send something to the Android app
acc.write(msg, 1); Create data that the Android app can read
//or read something
int len = acc.read(msg, sizeof(msg), 1); Read data from Android app into msg variable
}
}
19. Accessory Filter Resource
In xml/accessory_filter.xml:
<resources>
<usb-accessory
manufacturer="Manufacturer"
model="Model" Needs to match the Arduino sketch exactly
version="1.0" />
</resources>
20. Android Manifest
In AndroidManifest.xml (3.1+):
<manifest ...>
<uses-sdk android:minSdkVersion="12" />
<uses-feature android:name="android.hardware.usb.accessory" />
<application ...>
<activity ...>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter" />
From previous slide
<intent-filter>
<action
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
</intent-filter> Use intent filter to launch this activity
when ADK is plugged in
</activity>
</application>
</manifest>
21. Activity
In the .java file for your Activity (3.1+):
import com.android.hardware.usb.UsbAccessory;
import com.android.hardware.usb.UsbManager;
//...
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
UsbAccessory accessory =
(UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
ParcelFileDescriptor fileDescriptor = manager.openAccessory(accessory);
FileDescriptor fd = fileDescriptor.getFileDescriptor();
FileInputStream inputStream = new FileInputStream(fd);
byte[] buffer = new byte[16384];
Read data from the Arduino
int ret = inputStream.read(buffer); via a FileInputStream
FileOutputStream outputStream = new FileOutputStream(fd);
mOutputStream.write(buffer); Write data to the Arduino
via a FileOutputStream
22. Project ideas
So what can you make with the Open Accessory APIs
and an Arduino?
Things already
1+1=3
available Super
on your phone awesome stuff!
Electronics
components
you can add
23. Things already available on your phone
accelerometer touch screen
GPS camera
wifi/3G
mass storage
proximity/light temperature sensor
sensors
microphone NFC
klab.ca/spotlightandroid
24. Electronics components you can add
Electronics inputs and outputs using LittleBits as an example of various components
klab.ca/spotlightandroid
25. Super awesome stuff!
Music Beta: “Now Playing” by Chris Juergen Aerogarden Monitor by Sam Steele
Space Spheres by NASA Floating Sensor Project by UC Berkeley
klab.ca/spotlightandroid
26. Why Open Accessories are “open”
• iOS developer fees: $99/yr. • Fill out zero forms to start
developing.
• Approval required to be in MFi
program; must sign NDAs. • Pay nothing to Google -- now
or ever.
• Additional Apple licensing fees
and 3rd party certification. • No approval process from
Google to go to market.
• Final product needs to be
approved by Apple • USB connectors and drivers
are readily available.
• One supplier (Avent) produces
the connectors.
klab.ca/spotlightandroid
30. What is NFC?
NFC Scanner
Radiowaves
NFC Sticker:
antenna and flash storage
31. How is it different than RFID?
Low frequency radio waves
can travel far distances.
13.56MHz = NFC
High frequency waves cannot.
NFC works within 10cm only.
32. How is it different than RFID?
Storage with RFID is also limited to simple IDs
versus the complex data NFC tags can hold.
NFC Forum Popular Products Operations Rewrite Capabilities Available Memory Communication Price Range
Type of This Type Specifications Speed (price per unit)
1 Broadcom Topaz ISO 14443A User rewritable; can be 96 bytes, expandable to 2KB 106kbit/s Low
marked as read-only by (~$1-2 USD)
user
2 MIFARE ISO 14443A User rewritable; can be 48 bytes, 144 bytes is 106kbit/s Low
UltraLight marked as read-only by common, expandable to 2KB (~$1-2 USD)
user
3 Sony FeliCa JIS X 6319-4 Manufacture pre- variable, theoretical 1MB 212kbit/s or High
configured to be read- 424kbit/s (~$8-10 USD or
only or re-writable. higher)
4 NXP DESFire, NXP ISO 14443A, Manufacture pre- 4KBfor DESFire, up to Up to 424kbit/s Medium-High
SmartFX ISO 14443B configured to be read- 32KBfor SmartFX (~$3-4 USD)
only or rewritable.
MIFARE Operations Specifications Rewrite Capabilities Available Memory Communicatio Price Range
Type n Speed (price per unit)
Classic 1K ISO 14443A compatible, but NDEF User rewritable; only 752 bytes 106kbit/s Low
is formatted using a proprietary manufacturer can mark (~$1 USD)
protocol as read-only
Classic 4K ISO 14443A compatible, but NDEF User rewritable; only 3440 bytes 106kbit/s Low-Medium
is formatted using a proprietary manufacturer can mark (~$2 USD)
protocol as read-only
35. Activity - Reacting to NFC scans
In the .java file for your Activity:
import android.nfc.NfcAdapter;
import android.nfc.NfcAdapter.CreateNdefMessageCallback;
import android.nfc.NfcEvent;
//...
NfcAdapter mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
Boolean nfcEnabled = mNfcAdapter.isEnabled();
Give priority to the foreground
mNfcAdapter.enableForegroundDispatch(this, activity to receive NFC scan intents.
mNfcPendingIntent, mReadTagFilters, null);
Enable Android Beam for peer-to-peer
mNfcAdapter.setNdefPushMessageCallback(this,this);
36. Activity - Formatting to NDEF Format
In the .java file for your Activity:
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.tech.Ndef;
import android.nfc.tech.NdefFormatable;
//...
// get the values from the form's text fields:
Editable nameField = mName.getText();
JSONObject computerSpecs = new JSONObject(); JSON for readability,
not performance
computerSpecs.put("name", nameField);
String data = computerSpecs.toString();
// create a new NDEF record w/ NDEF message using the app's custom MIME type:
String mimeType = "application/root.gast.playground.nfc"; Unique to your app
byte[] mimeBytes = mimeType.getBytes(Charset.forName("UTF-8"));
byte[] dataBytes = data.getBytes(Charset.forName("UTF-8"));
byte[] id = new byte[0];
NdefRecord record = new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
mimeBytes, id, dataBytes); Not hard at all!
NdefMessage m = new NdefMessage(new NdefRecord[] { record });
37. Activity - Reading NDEF Format
In the .java file for your Activity:
import android.nfc.Tag;
//...
Parcelable[] rawMsgs =
intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
NdefMessage[] msgs = new NdefMessage[rawMsgs.length];
for (int i = 0; i < rawMsgs.length; i++) {
msgs[i] = (NdefMessage) rawMsgs[i];
}
NdefRecord record = msgs[0].getRecords()[0];
The info you wanted.
byte[] payload = record.getPayload(); (e.g. string or json)
38. A case for NFC
• Create low friction interactions
• Augment physical objects (even offline)
• Make your software app more tangible
• Engage others to share and connect
• Increase the viralness of your app
• Possibility to be platform agnostic
klab.ca/spotlightandroid
39. Mobile OS support for NFC
Chart updated for Sept 27, 2012
klab.ca/spotlightandroid
40. Don’t worry, this isn’t Apple bashing...
Hey! What By touching
did you just do phones?
there?
Oh, I just sent
him a playlist.
klab.ca/spotlightandroid
41. Thank you!
Oh, and check out some upcoming Arduino workshops!
Sign up for mailing list on karma-laboratory.com.
Pearl Chen Google+: klab.ca/+
pearl@karma-laboratory.com Twitter: @PearlChen
klab.ca/spotlightandroid