SlideShare a Scribd company logo
1 of 36
Download to read offline
Writing Mirror API & 

Native Applications for

Jean-Luc David

jldavid@gmail.com

jldavid.com

@jldavid

Who am I?
- Freelance wearables developer	
  
- Wrote 5 books for Wiley Publishing

- Worked at Yellow Pages Group,

Microsoft, Digiflare Inc.

- I love hackathons

Everyone in this room will

get to try out
!
What is Google Glass?
- Galaxy Nexus - Android 4.0.4, dual-core	
  
- Battery ≤ 1 day	
  
- 5MPX camera, 720p video, touchpad	
  
- Display 640x360px (= 25' HD screen 2m)	
  
- Gyroscope, accelerometer, compass	
  
- Wifi, BT, GPS	
  
- 16 GB, 682 RAM	
  
- Sound “bone conduction”	
  
- Microphone, eye tracker	
  
- Calls/sms/gps/internet through phone	
  

Why Wearables?
	
  	
  

	
  	
  

	
  	
  

	
  	
  

	
  	
  
	
  	
  
	
  	
  

	
  	
  
Source: Everett Rogers - Diffusion of Evolution
Why Wearables?

Source: Morgan Stanley Research
What are the programming
models for
?
Glass Developer Kit
	
  	
  
What are the programming
models for
?
Mirror API
	
  	
  
Demo: PictureThis
Basic Android Application

Layout.xml

	
  	
  

Layout.xml

Intent
Activity #1

Activity #2
Glass Application

Card.xml

Card.xml

Card.xml

Card.xml

	
  	
  

CardScrollView

CardScrollView

Intent
Activity #1

Activity #2
Glass Timeline
Glass Application with Live Cards

& Immersions
Launching Glass Apps
Launching Glass Apps
res/values/strings.xml 


!

<?xml version="1.0" encoding="utf-8"?>

<resources>

   <string name="glass_voice_trigger">take note</string>

   <string name="glass_voice_prompt">what's on your mind?</string>

</resources>	
  

!

res/xml/<my_voice_trigger>.xml



<?xml version="1.0" encoding="utf-8"?>

<trigger keyword="@string/glass_voice_trigger">

  <input prompt="@string/glass_voice_prompt" />

</trigger>
Launching Glass Apps
AndroidManifest.xml 



<?xml version="1.0" encoding="utf-8"?>

<application ...>

    <activity ...>

        <intent-filter>

            <action           


android:name="com.google.android.glass.action.VOICE_TRIGGER"/>

        </intent-filter>

        <meta-data 

android:name="com.google.android.glass.VoiceTrigger"

  android:resource="@xml/my_voice_trigger" />

    </activity>

    // ...

</application>
Voice Commands
Voice Commands
private void displaySpeechRecognizer() {	
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);	
  
startActivityForResult(intent, SPEECH_REQUEST);	
  
}


!

protected void onActivityResult(int reqCode, int resCode, Intent data)
{	
if (reqCode == SPEECH_REQUEST && resCode == RESULT_OK) {	
  
List<String> results = data.getStringArrayListExtra(

RecognizerIntent.EXTRA_RESULTS);	
  
String spokenText = results.get(0);	
  
Log.e("SPOKEN TEXT", spokenText);	
}	
  
super.onActivityResult(requestCode, resultCode, data);	
  
}
Read Aloud
Read Aloud
import android.speech.tts.TextToSpeech;	
  
...	

private TextToSpeech mSpeech;	
  

!

public void onCreate() {	
  
super.onCreate();	
  
mSpeech = new TextToSpeech(this, 

new TextToSpeech.OnInitListener() {	
  
@Override	
  
public void onInit(int status) {	
  
// Do nothing.	
  
}	
});	
}	
  

!
Read Aloud
public void sayStuff() 	
{	
  
String helloWorld = "hello world";	
mSpeech.speak(helloWorld, TextToSpeech.QUEUE_FLUSH, null);	
  
}
Camera
Camera
// Start Camera Intent	
  
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);	
  
startActivityForResult(cameraIntent, TAKE_PICTURE_REQUEST);	
  

!

@Override	
  
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {	
  
	
if (requestCode == TAKE_PICTURE_REQUEST 

&& resultCode == RESULT_OK) {	
  
String picturePath = 

data.getStringExtra(CameraManager.EXTRA_PICTURE_FILE_PATH);	
  
	
processPictureWhenReady(picturePath);	
	
  
	
}	
	
super.onActivityResult(requestCode, resultCode, data);	
  
}
Camera
private void processPictureWhenReady(final String picturePath) {	
  
final File pictureFile = new File(picturePath);	
  
if (pictureFile.exists()) {	
  
	
// Picture Exists	
} else {	
  
final File directory = pictureFile.getParentFile();	
  
FileObserver observer = new 

FileObserver(parentDirectory.getPath()) {	
  
private boolean isFileWritten;
Camera
@Override	
  
public void onEvent(int event, String path) {	
  
if (!isFileWritten) {	
  
File affectedFile = new File(parentDirectory, path);	
  
isFileWritten = (event == FileObserver.CLOSE_WRITE	
&& affectedFile.equals(pictureFile));	
if (isFileWritten) {	
  
stopWatching();	
runOnUiThread(new Runnable() {	
  
@Override	
  
public void run() {	
  
	
	
	
// File Exists	
	
	
	
}	
});	
  
}}}};	
  
observer.startWatching();	
  
}	
  
}
Demo: Stereo
Cards
Cards
<?php	
// Add includes & OAuth Check


!

// Set up client	
$client = get_google_api_client();	
$bundleVer = 15;	
  
$mirror_service = new Google_MirrorService($client);	
  

!

$new_timeline_item = new Google_TimelineItem();	
  
$new_timeline_item->setHTML("<article class='photo'><img
style='width:100%; height:100%;' src='http://stereo.com/
splash.png'></article>");	
  
$new_timeline_item->setBundleId($bundleVer);	
  
$new_timeline_item->setIsBundleCover(false);	
  
$notification = new Google_NotificationConfig();	
  
$notification->setLevel("DEFAULT");	
  
$new_timeline_item->setNotification($notification);
Cards
// A custom menu item	
  
$menu_items = array();	
  
$custom_menu_item = new Google_MenuItem();	
  
$custom_menu_value = new Google_MenuValue();	
  
$custom_menu_value->setDisplayName("Drill Into");	
  
$custom_menu_value->setIconUrl($service_base_url."/static/images/
drill.png");	
$custom_menu_item->setValues(array($custom_menu_value));	
  
$custom_menu_item->setAction("REPLY");	
  

!

// This is how you identify it on the notification ping	
  
$custom_menu_item->setId("safe-for-later");	
  
array_push($menu_items, $custom_menu_item);	
  
$new_timeline_item->setMenuItems($menu_items);	
  

!

insert_timeline_item($mirror_service, $new_timeline_item, null,
null);	
  
?>
Audio/Video
Audio/Video
<?php	
// Includes & OAuth Check

// Setup Client	
$client = get_google_api_client();	
$mirror_service = new Google_MirrorService($client);	
  

!

// Create a new timeline item, notify & insert audio	
$new_timeline_item = new Google_TimelineItem();	
  
$new_timeline_item->setText("Audio Stream");	
  

!

$notification = new Google_NotificationConfig();	
  
$notification->setLevel("DEFAULT");	
  
$new_timeline_item->setNotification($notification);	
  

!

insert_timeline_item($mirror_service, $new_timeline_item, "video/
vnd.google-glass.stream-url", "https://api.soundcloud.com/tracks/
102874582/stream?consumer_key=apigee");	
  
?>
Maps
Maps
<?	
  
// Includes & OAuth Check

// Set up Mirror API client	
  
$bundle_id = "map";	
  
$client = get_google_api_client();	
  
mirror_service = new Google_MirrorService($client);	
  

!

// Search Results Card	
  
$results_html = "<img src="glass://map?w=640&h=360&marker=0;	
  
42.369590,-71.107132" width="640" height="360" />";	
  
$new_timeline_item = new Google_TimelineItem();	
  
$new_timeline_item->setHTML($results_html);	
  
$new_timeline_item->setBundleId($bundle_id);	
  
$new_timeline_item->setIsBundleCover(false);

Maps
// Set Notification Level	
$notification = new Google_NotificationConfig();	
  
$notification->setLevel("DEFAULT");	
  
$new_timeline_item->setNotification($notification);	
  

!

// Add Menu Item	
$menu_items = array();	
  
$menu_item = new Google_MenuItem();	
  
$menu_item->setAction("DELETE");	
  
array_push($menu_items, $menu_item);	
  

!

// Insert into Google Glass Timeline	
$new_timeline_item->setMenuItems($menu_items);	
  
insert_timeline_item($mirror_service, $new_timeline_item, null,
null,null);	
?>
When will it be available?
I don't know.

+
How can I get my own pair?
	
   	
  

- Be U.S. residents
- Be at least 18 years old
- Purchase Glass for $1,500 + tax within the US
- Provide a US shipping address or pick up their 

Glass at one of our locations in New York, San 

Francisco or Los Angeles

	
  
Thank you!
Slides: http://www.jldavid.com

Glass Dev: https://developers.google.com/
glass/

Want an app built or have questions?



Jean-Luc David

jldavid@gmail.com

@jldavid


More Related Content

What's hot

Building Glassware with the Glass Development Kit
Building Glassware with the Glass Development KitBuilding Glassware with the Glass Development Kit
Building Glassware with the Glass Development KitEveryware Technologies
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shemaMurat Gülci
 
WordPress as an application framework
WordPress as an application frameworkWordPress as an application framework
WordPress as an application frameworkDustin Filippini
 
MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentialszahid-mian
 
Drupalcamp gent - Node access
Drupalcamp gent - Node accessDrupalcamp gent - Node access
Drupalcamp gent - Node accessJasper Knops
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)nyccamp
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConRafael Dohms
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
Open Network Lab (At Tokyo 2point0)
Open Network Lab (At Tokyo 2point0)Open Network Lab (At Tokyo 2point0)
Open Network Lab (At Tokyo 2point0)Open Network Lab
 
Meet Magento Belarus debug Pavel Novitsky (eng)
Meet Magento Belarus debug Pavel Novitsky (eng)Meet Magento Belarus debug Pavel Novitsky (eng)
Meet Magento Belarus debug Pavel Novitsky (eng)Pavel Novitsky
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections modulePablo Enfedaque
 
Intro to advanced caching in WordPress
Intro to advanced caching in WordPressIntro to advanced caching in WordPress
Intro to advanced caching in WordPressMaor Chasen
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #statesKonstantin Käfer
 
First meet with Android Auto
First meet with Android AutoFirst meet with Android Auto
First meet with Android AutoJohnny Sung
 
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICESONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICESDrupalCamp Kyiv
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency InjectionRifat Nabi
 
Erlang for data ops
Erlang for data opsErlang for data ops
Erlang for data opsmnacos
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An AnalysisJustin Finkelstein
 

What's hot (20)

Building Glassware with the Glass Development Kit
Building Glassware with the Glass Development KitBuilding Glassware with the Glass Development Kit
Building Glassware with the Glass Development Kit
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
 
WordPress as an application framework
WordPress as an application frameworkWordPress as an application framework
WordPress as an application framework
 
MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentials
 
Drupalcamp gent - Node access
Drupalcamp gent - Node accessDrupalcamp gent - Node access
Drupalcamp gent - Node access
 
MongoDB With Style
MongoDB With StyleMongoDB With Style
MongoDB With Style
 
Php
PhpPhp
Php
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
Open Network Lab (At Tokyo 2point0)
Open Network Lab (At Tokyo 2point0)Open Network Lab (At Tokyo 2point0)
Open Network Lab (At Tokyo 2point0)
 
Meet Magento Belarus debug Pavel Novitsky (eng)
Meet Magento Belarus debug Pavel Novitsky (eng)Meet Magento Belarus debug Pavel Novitsky (eng)
Meet Magento Belarus debug Pavel Novitsky (eng)
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections module
 
Intro to advanced caching in WordPress
Intro to advanced caching in WordPressIntro to advanced caching in WordPress
Intro to advanced caching in WordPress
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #states
 
First meet with Android Auto
First meet with Android AutoFirst meet with Android Auto
First meet with Android Auto
 
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICESONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Erlang for data ops
Erlang for data opsErlang for data ops
Erlang for data ops
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An Analysis
 

Viewers also liked

Video and Screencasting Apps for Learning
Video and Screencasting Apps for LearningVideo and Screencasting Apps for Learning
Video and Screencasting Apps for LearningKaren Bosch
 
4g technology seminar ppt
4g technology seminar ppt4g technology seminar ppt
4g technology seminar pptShreya Thakur
 
ppt on 4g
ppt on 4gppt on 4g
ppt on 4gPPT4U
 
4g wireless final ppt
4g wireless  final ppt4g wireless  final ppt
4g wireless final pptShelly
 

Viewers also liked (6)

Video and Screencasting Apps for Learning
Video and Screencasting Apps for LearningVideo and Screencasting Apps for Learning
Video and Screencasting Apps for Learning
 
4 g technology
4 g technology4 g technology
4 g technology
 
4g technology seminar ppt
4g technology seminar ppt4g technology seminar ppt
4g technology seminar ppt
 
ppt on 4g
ppt on 4gppt on 4g
ppt on 4g
 
4g wireless final ppt
4g wireless  final ppt4g wireless  final ppt
4g wireless final ppt
 
4g technology
4g technology4g technology
4g technology
 

Similar to Writing Mirror API and Native Apps for Google Glass

Androidの音声認識とテキスト読み上げ機能について
Androidの音声認識とテキスト読み上げ機能についてAndroidの音声認識とテキスト読み上げ機能について
Androidの音声認識とテキスト読み上げ機能についてmoai kids
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Alfredo Morresi
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015Fernando Daciuk
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013Mathias Seguy
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps OfflinePedro Morais
 
The Australian-The Deal Magazine
The Australian-The Deal MagazineThe Australian-The Deal Magazine
The Australian-The Deal Magazinedrocallaghan
 
TechDay: Kick Start Your Experience with Android Wear - Mario Viviani
TechDay: Kick Start Your Experience with Android Wear - Mario VivianiTechDay: Kick Start Your Experience with Android Wear - Mario Viviani
TechDay: Kick Start Your Experience with Android Wear - Mario VivianiCodemotion
 
Kick start your experience with android wear - Codemotion Rome 2015
Kick start your experience with android wear - Codemotion Rome 2015Kick start your experience with android wear - Codemotion Rome 2015
Kick start your experience with android wear - Codemotion Rome 2015Codemotion
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegapyangdj
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaveryangdj
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google GlassJohnny Sung
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applicationsjeromevdl
 

Similar to Writing Mirror API and Native Apps for Google Glass (20)

Androidの音声認識とテキスト読み上げ機能について
Androidの音声認識とテキスト読み上げ機能についてAndroidの音声認識とテキスト読み上げ機能について
Androidの音声認識とテキスト読み上げ機能について
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013
 
Minicurso Android
Minicurso AndroidMinicurso Android
Minicurso Android
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
mobl
moblmobl
mobl
 
Mini curso Android
Mini curso AndroidMini curso Android
Mini curso Android
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
The Australian-The Deal Magazine
The Australian-The Deal MagazineThe Australian-The Deal Magazine
The Australian-The Deal Magazine
 
TechDay: Kick Start Your Experience with Android Wear - Mario Viviani
TechDay: Kick Start Your Experience with Android Wear - Mario VivianiTechDay: Kick Start Your Experience with Android Wear - Mario Viviani
TechDay: Kick Start Your Experience with Android Wear - Mario Viviani
 
Kick start your experience with android wear - Codemotion Rome 2015
Kick start your experience with android wear - Codemotion Rome 2015Kick start your experience with android wear - Codemotion Rome 2015
Kick start your experience with android wear - Codemotion Rome 2015
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google Glass
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
 

More from Jean-Luc David

Implementing Biometric Authentication & Features in iOS Apps
Implementing Biometric Authentication & Features in iOS AppsImplementing Biometric Authentication & Features in iOS Apps
Implementing Biometric Authentication & Features in iOS AppsJean-Luc David
 
Add Machine Learning to your iOS 11 App Using Core ML
Add Machine Learning to your iOS 11 App Using Core MLAdd Machine Learning to your iOS 11 App Using Core ML
Add Machine Learning to your iOS 11 App Using Core MLJean-Luc David
 
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)Jean-Luc David
 
Intro to HTTP and Node.js
Intro to HTTP and Node.jsIntro to HTTP and Node.js
Intro to HTTP and Node.jsJean-Luc David
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJean-Luc David
 
Venture For Canada - Growing Your Startup
Venture For Canada - Growing Your StartupVenture For Canada - Growing Your Startup
Venture For Canada - Growing Your StartupJean-Luc David
 
Venture For Canada - Growth Marketing
Venture For Canada - Growth MarketingVenture For Canada - Growth Marketing
Venture For Canada - Growth MarketingJean-Luc David
 
Venture For Canada - Growth Hacking
Venture For Canada - Growth HackingVenture For Canada - Growth Hacking
Venture For Canada - Growth HackingJean-Luc David
 
Startup Product Management - Analytics
Startup Product Management - AnalyticsStartup Product Management - Analytics
Startup Product Management - AnalyticsJean-Luc David
 
Startup Product Management - Execution
Startup Product Management - ExecutionStartup Product Management - Execution
Startup Product Management - ExecutionJean-Luc David
 
Startup Product Management - Planning
Startup Product Management - PlanningStartup Product Management - Planning
Startup Product Management - PlanningJean-Luc David
 
Building WatchKit Applications
Building WatchKit ApplicationsBuilding WatchKit Applications
Building WatchKit ApplicationsJean-Luc David
 
Confoo Developing for Wearables
Confoo   Developing for WearablesConfoo   Developing for Wearables
Confoo Developing for WearablesJean-Luc David
 
Innovation & Business Acquisitions of Smart Security
Innovation & Business Acquisitions of Smart SecurityInnovation & Business Acquisitions of Smart Security
Innovation & Business Acquisitions of Smart SecurityJean-Luc David
 
Developing For Wearables - Lessons Learned & Best Practices
Developing For Wearables - Lessons Learned & Best PracticesDeveloping For Wearables - Lessons Learned & Best Practices
Developing For Wearables - Lessons Learned & Best PracticesJean-Luc David
 
Developing for Wearables
Developing for WearablesDeveloping for Wearables
Developing for WearablesJean-Luc David
 
Ryerson DMZ iOS Development Workshop
Ryerson DMZ iOS Development WorkshopRyerson DMZ iOS Development Workshop
Ryerson DMZ iOS Development WorkshopJean-Luc David
 
Pigeon Presentation at We Are Wearables Toronto
Pigeon Presentation at We Are Wearables TorontoPigeon Presentation at We Are Wearables Toronto
Pigeon Presentation at We Are Wearables TorontoJean-Luc David
 

More from Jean-Luc David (20)

Implementing Biometric Authentication & Features in iOS Apps
Implementing Biometric Authentication & Features in iOS AppsImplementing Biometric Authentication & Features in iOS Apps
Implementing Biometric Authentication & Features in iOS Apps
 
Add Machine Learning to your iOS 11 App Using Core ML
Add Machine Learning to your iOS 11 App Using Core MLAdd Machine Learning to your iOS 11 App Using Core ML
Add Machine Learning to your iOS 11 App Using Core ML
 
Mobile Portfolio
Mobile PortfolioMobile Portfolio
Mobile Portfolio
 
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)
Mike Krieger - A Brief, Rapid History of Scaling Instagram (with a tiny team)
 
Intro to HTTP and Node.js
Intro to HTTP and Node.jsIntro to HTTP and Node.js
Intro to HTTP and Node.js
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Venture For Canada - Growing Your Startup
Venture For Canada - Growing Your StartupVenture For Canada - Growing Your Startup
Venture For Canada - Growing Your Startup
 
Venture For Canada - Growth Marketing
Venture For Canada - Growth MarketingVenture For Canada - Growth Marketing
Venture For Canada - Growth Marketing
 
Venture For Canada - Growth Hacking
Venture For Canada - Growth HackingVenture For Canada - Growth Hacking
Venture For Canada - Growth Hacking
 
Startup Product Management - Analytics
Startup Product Management - AnalyticsStartup Product Management - Analytics
Startup Product Management - Analytics
 
Startup Product Management - Execution
Startup Product Management - ExecutionStartup Product Management - Execution
Startup Product Management - Execution
 
Startup Product Management - Planning
Startup Product Management - PlanningStartup Product Management - Planning
Startup Product Management - Planning
 
RightCycle
RightCycleRightCycle
RightCycle
 
Building WatchKit Applications
Building WatchKit ApplicationsBuilding WatchKit Applications
Building WatchKit Applications
 
Confoo Developing for Wearables
Confoo   Developing for WearablesConfoo   Developing for Wearables
Confoo Developing for Wearables
 
Innovation & Business Acquisitions of Smart Security
Innovation & Business Acquisitions of Smart SecurityInnovation & Business Acquisitions of Smart Security
Innovation & Business Acquisitions of Smart Security
 
Developing For Wearables - Lessons Learned & Best Practices
Developing For Wearables - Lessons Learned & Best PracticesDeveloping For Wearables - Lessons Learned & Best Practices
Developing For Wearables - Lessons Learned & Best Practices
 
Developing for Wearables
Developing for WearablesDeveloping for Wearables
Developing for Wearables
 
Ryerson DMZ iOS Development Workshop
Ryerson DMZ iOS Development WorkshopRyerson DMZ iOS Development Workshop
Ryerson DMZ iOS Development Workshop
 
Pigeon Presentation at We Are Wearables Toronto
Pigeon Presentation at We Are Wearables TorontoPigeon Presentation at We Are Wearables Toronto
Pigeon Presentation at We Are Wearables Toronto
 

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 

Writing Mirror API and Native Apps for Google Glass

  • 1. Writing Mirror API & 
 Native Applications for Jean-Luc David
 jldavid@gmail.com
 jldavid.com
 @jldavid

  • 2. Who am I? - Freelance wearables developer   - Wrote 5 books for Wiley Publishing
 - Worked at Yellow Pages Group,
 Microsoft, Digiflare Inc.
 - I love hackathons Everyone in this room will
 get to try out !
  • 3. What is Google Glass? - Galaxy Nexus - Android 4.0.4, dual-core   - Battery ≤ 1 day   - 5MPX camera, 720p video, touchpad   - Display 640x360px (= 25' HD screen 2m)   - Gyroscope, accelerometer, compass   - Wifi, BT, GPS   - 16 GB, 682 RAM   - Sound “bone conduction”   - Microphone, eye tracker   - Calls/sms/gps/internet through phone   
  • 4. Why Wearables?                                 Source: Everett Rogers - Diffusion of Evolution
  • 5. Why Wearables? Source: Morgan Stanley Research
  • 6. What are the programming models for ? Glass Developer Kit    
  • 7. What are the programming models for ? Mirror API    
  • 9. Basic Android Application Layout.xml     Layout.xml Intent Activity #1 Activity #2
  • 10. Glass Application Card.xml Card.xml Card.xml Card.xml     CardScrollView CardScrollView Intent Activity #1 Activity #2
  • 12. Glass Application with Live Cards
 & Immersions
  • 14. Launching Glass Apps res/values/strings.xml 
 ! <?xml version="1.0" encoding="utf-8"?>
 <resources>
    <string name="glass_voice_trigger">take note</string>
    <string name="glass_voice_prompt">what's on your mind?</string>
 </resources>   ! res/xml/<my_voice_trigger>.xml
 
 <?xml version="1.0" encoding="utf-8"?>
 <trigger keyword="@string/glass_voice_trigger">
   <input prompt="@string/glass_voice_prompt" />
 </trigger>
  • 15. Launching Glass Apps AndroidManifest.xml 
 
 <?xml version="1.0" encoding="utf-8"?>
 <application ...>
     <activity ...>
         <intent-filter>
             <action            
 android:name="com.google.android.glass.action.VOICE_TRIGGER"/>
         </intent-filter>
         <meta-data 
 android:name="com.google.android.glass.VoiceTrigger"
   android:resource="@xml/my_voice_trigger" />
     </activity>
     // ...
 </application>
  • 17. Voice Commands private void displaySpeechRecognizer() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);   startActivityForResult(intent, SPEECH_REQUEST);   }
 ! protected void onActivityResult(int reqCode, int resCode, Intent data) { if (reqCode == SPEECH_REQUEST && resCode == RESULT_OK) {   List<String> results = data.getStringArrayListExtra(
 RecognizerIntent.EXTRA_RESULTS);   String spokenText = results.get(0);   Log.e("SPOKEN TEXT", spokenText); }   super.onActivityResult(requestCode, resultCode, data);   }
  • 19. Read Aloud import android.speech.tts.TextToSpeech;   ... private TextToSpeech mSpeech;   ! public void onCreate() {   super.onCreate();   mSpeech = new TextToSpeech(this, 
 new TextToSpeech.OnInitListener() {   @Override   public void onInit(int status) {   // Do nothing.   } }); }   !
  • 20. Read Aloud public void sayStuff() {   String helloWorld = "hello world"; mSpeech.speak(helloWorld, TextToSpeech.QUEUE_FLUSH, null);   }
  • 22. Camera // Start Camera Intent   Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);   startActivityForResult(cameraIntent, TAKE_PICTURE_REQUEST);   ! @Override   protected void onActivityResult(int requestCode, int resultCode, Intent data) {   if (requestCode == TAKE_PICTURE_REQUEST 
 && resultCode == RESULT_OK) {   String picturePath = 
 data.getStringExtra(CameraManager.EXTRA_PICTURE_FILE_PATH);   processPictureWhenReady(picturePath);   } super.onActivityResult(requestCode, resultCode, data);   }
  • 23. Camera private void processPictureWhenReady(final String picturePath) {   final File pictureFile = new File(picturePath);   if (pictureFile.exists()) {   // Picture Exists } else {   final File directory = pictureFile.getParentFile();   FileObserver observer = new 
 FileObserver(parentDirectory.getPath()) {   private boolean isFileWritten;
  • 24. Camera @Override   public void onEvent(int event, String path) {   if (!isFileWritten) {   File affectedFile = new File(parentDirectory, path);   isFileWritten = (event == FileObserver.CLOSE_WRITE && affectedFile.equals(pictureFile)); if (isFileWritten) {   stopWatching(); runOnUiThread(new Runnable() {   @Override   public void run() {   // File Exists } });   }}}};   observer.startWatching();   }   }
  • 26. Cards
  • 27. Cards <?php // Add includes & OAuth Check
 ! // Set up client $client = get_google_api_client(); $bundleVer = 15;   $mirror_service = new Google_MirrorService($client);   ! $new_timeline_item = new Google_TimelineItem();   $new_timeline_item->setHTML("<article class='photo'><img style='width:100%; height:100%;' src='http://stereo.com/ splash.png'></article>");   $new_timeline_item->setBundleId($bundleVer);   $new_timeline_item->setIsBundleCover(false);   $notification = new Google_NotificationConfig();   $notification->setLevel("DEFAULT");   $new_timeline_item->setNotification($notification);
  • 28. Cards // A custom menu item   $menu_items = array();   $custom_menu_item = new Google_MenuItem();   $custom_menu_value = new Google_MenuValue();   $custom_menu_value->setDisplayName("Drill Into");   $custom_menu_value->setIconUrl($service_base_url."/static/images/ drill.png"); $custom_menu_item->setValues(array($custom_menu_value));   $custom_menu_item->setAction("REPLY");   ! // This is how you identify it on the notification ping   $custom_menu_item->setId("safe-for-later");   array_push($menu_items, $custom_menu_item);   $new_timeline_item->setMenuItems($menu_items);   ! insert_timeline_item($mirror_service, $new_timeline_item, null, null);   ?>
  • 30. Audio/Video <?php // Includes & OAuth Check
 // Setup Client $client = get_google_api_client(); $mirror_service = new Google_MirrorService($client);   ! // Create a new timeline item, notify & insert audio $new_timeline_item = new Google_TimelineItem();   $new_timeline_item->setText("Audio Stream");   ! $notification = new Google_NotificationConfig();   $notification->setLevel("DEFAULT");   $new_timeline_item->setNotification($notification);   ! insert_timeline_item($mirror_service, $new_timeline_item, "video/ vnd.google-glass.stream-url", "https://api.soundcloud.com/tracks/ 102874582/stream?consumer_key=apigee");   ?>
  • 31. Maps
  • 32. Maps <?   // Includes & OAuth Check
 // Set up Mirror API client   $bundle_id = "map";   $client = get_google_api_client();   mirror_service = new Google_MirrorService($client);   ! // Search Results Card   $results_html = "<img src="glass://map?w=640&h=360&marker=0;   42.369590,-71.107132" width="640" height="360" />";   $new_timeline_item = new Google_TimelineItem();   $new_timeline_item->setHTML($results_html);   $new_timeline_item->setBundleId($bundle_id);   $new_timeline_item->setIsBundleCover(false);

  • 33. Maps // Set Notification Level $notification = new Google_NotificationConfig();   $notification->setLevel("DEFAULT");   $new_timeline_item->setNotification($notification);   ! // Add Menu Item $menu_items = array();   $menu_item = new Google_MenuItem();   $menu_item->setAction("DELETE");   array_push($menu_items, $menu_item);   ! // Insert into Google Glass Timeline $new_timeline_item->setMenuItems($menu_items);   insert_timeline_item($mirror_service, $new_timeline_item, null, null,null); ?>
  • 34. When will it be available? I don't know. +
  • 35. How can I get my own pair?     - Be U.S. residents - Be at least 18 years old - Purchase Glass for $1,500 + tax within the US - Provide a US shipping address or pick up their 
 Glass at one of our locations in New York, San 
 Francisco or Los Angeles  
  • 36. Thank you! Slides: http://www.jldavid.com
 Glass Dev: https://developers.google.com/ glass/ Want an app built or have questions?
 
 Jean-Luc David
 jldavid@gmail.com
 @jldavid