Building Glassware with the Glass Development Kit

755 views
623 views

Published on

An introduction to the development of software applications for Google Glass (Glassware) using the preview version of the Glass Development Kit extension to Android. To illustrate the GDK, we have created a sample application, called Breaking Glass, based on the awesome TV series Breaking Bad

Video of the presentation: https://www.youtube.com/watch?v=pV2_HjZk1W0

Code available on: https://github.com/everywaretech/BreakingGlass

Published in: Software, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
755
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Building Glassware with the Glass Development Kit

  1. 1. Building GDK Glassware with the Tomás Ruiz-López Software Design Manager at Everyware Technologies @tomasruizlopez @everywaretech /everywaretech http://www.everywaretech.es
  2. 2. Everyware Technologies Spinoff UGR Business areas
  3. 3. Everyware Technologies Spinoff UGR 1 Consulting
  4. 4. Everyware Technologies Spinoff UGR 2 Training
  5. 5. Everyware Technologies Spinoff UGR 3 Development Android iOS BlackBerry Web Android Wear Chromecast Google Glass
  6. 6. Glass Development Kit 1 Real-time user interaction
  7. 7. 2 Offline functionality Glass Development Kit
  8. 8. 3 Access to Hardware Glass Development Kit
  9. 9. Breaking Glass Sample Glassware Demo
  10. 10. Live Cards Currently cooking for 1683 people High-frequency rendering
  11. 11. Live Cards Currently cooking for 1683 peopleOk Glass, find a recipe High-frequency rendering
  12. 12. Live Cards Currently cooking for 1683 peopleOk Glass, find a recipe Breaking Service Service High-frequency rendering
  13. 13. Live Cards Currently cooking for 1683 peopleOk Glass, find a recipe Breaking Service Service <service android:name="es.everywaretech.breakingglass.BreakingService" android:label="@string/app_name" android:enabled="true" android:exported="true"> <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/voice_trigger_start" /> </service> Android Manifest High-frequency rendering
  14. 14. Live Cards Currently cooking for 1683 peopleOk Glass, find a recipe Breaking Service Service <service android:name="es.everywaretech.breakingglass.BreakingService" android:label="@string/app_name" android:enabled="true" android:exported="true"> <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/voice_trigger_start" /> </service> Android Manifest <trigger command="FIND_A_RECIPE" /> xml/voice_trigger_start.xml High-frequency rendering
  15. 15. Currently cooking for 1683 people Breaking Service Service Live Cards Ok Glass, find a recipe High-frequency rendering
  16. 16. Currently cooking for 1683 people Breaking Service Service Live Card Live Card Live Cards Ok Glass, find a recipe High-frequency rendering
  17. 17. Currently cooking for 1683 people Breaking Service Service Breaking Drawer Direct Rendering Callback Live Card Live Card Live Cards Ok Glass, find a recipe High-frequency rendering
  18. 18. Currently cooking for 1683 people Breaking Service Service Breaking Drawer Direct Rendering Callback Breaking View View Live Card Live Card Live Cards Ok Glass, find a recipe High-frequency rendering
  19. 19. Currently cooking for 1683 people Breaking Service Service Breaking Drawer Direct Rendering Callback Breaking View View Breaking Activity Activity action Live Card Live Card Live Cards Ok Glass, find a recipe High-frequency rendering
  20. 20. Currently cooking for 1683 people Live CardsHigh-frequency rendering
  21. 21. Currently cooking for 1683 people Live CardsHigh-frequency rendering liveCard = new LiveCard(this, LIVE_CARD_TAG); ! callback = new BreakingDrawer(this); liveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(callback); ! Intent menuIntent = new Intent(this, BreakingActivity.class); menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); liveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0)); liveCard.attach(this); ! liveCard.publish(PublishMode.REVEAL); BreakingService
  22. 22. Menus
  23. 23. Menus Breaking Activity Activity
  24. 24. Menus Breaking Activity Activity Menu
  25. 25. Menus Breaking Activity Activity Recipe Activity Activity onOptionsItemSelected() Menu
  26. 26. Static Cards
  27. 27. Static Cards Recipe Activity Activity
  28. 28. Static Cards Recipe Activity Activity Content View CardScroll View
  29. 29. Static Cards Recipe Activity Activity Content View CardScroll View Recipe Adapter CardScroll Adapter
  30. 30. Static Cards Recipe Activity Activity Content View CardScroll View Recipe Adapter CardScroll Adapter ContentContentContentContent Card
  31. 31. Static Cards Recipe Activity Activity Content View CardScroll View Recipe Adapter CardScroll Adapter ContentContentContentContent Card
  32. 32. Static Cards
  33. 33. Static Cards adapter = new RecipeAdapter(createCards(this)); scrollView = new CardScrollView(this); scrollView.setAdapter(adapter); scrollView.activate(); setContentView(scrollView); setCardScrollerListener(); RecipeActivity.onCreate()
  34. 34. Static Cards adapter = new RecipeAdapter(createCards(this)); scrollView = new CardScrollView(this); scrollView.setAdapter(adapter); scrollView.activate(); setContentView(scrollView); setCardScrollerListener(); RecipeActivity.onCreate() Card c = new Card(context); c.setImageLayout(Card.ImageLayout.FULL); c.setText("Your blue meth-candy is ready"); c.setFootnote("Tap to start selling it"); c.addImage(R.drawable.s09); RecipeActivity.createCards()
  35. 35. Notifications
  36. 36. Notifications Recipe Activity Activity
  37. 37. Notifications Recipe Activity Activity Alarm Manager
  38. 38. Notifications Recipe Activity Activity Alarm Manager Intent intent = new Intent(this, SellingBroadcastReceiver.class); PendingIntent pending = PendingIntent.getBroadcast(this, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager am = (AlarmManager) this.getSystemService( Context.ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 20*1000, pending);
  39. 39. Notifications Recipe Activity Activity Alarm Manager Intent intent = new Intent(this, SellingBroadcastReceiver.class); PendingIntent pending = PendingIntent.getBroadcast(this, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager am = (AlarmManager) this.getSystemService( Context.ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 20*1000, pending); Selling Broadcast Receiver Broadcast Receiver time goes by…
  40. 40. Notifications Recipe Activity Activity Alarm Manager Selling Service Service Intent intent = new Intent(this, SellingBroadcastReceiver.class); PendingIntent pending = PendingIntent.getBroadcast(this, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager am = (AlarmManager) this.getSystemService( Context.ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 20*1000, pending); Selling Broadcast Receiver Broadcast Receiver time goes by…
  41. 41. Live CardsLow-frequency rendering
  42. 42. Live Cards Selling Service Service Low-frequency rendering
  43. 43. Live Cards Selling Service Service Low-frequency rendering Live Card Live Card
  44. 44. Live Cards Selling Service Service Low-frequency rendering Live Card Live Card View RemoteViews
  45. 45. Live CardsLow-frequency rendering
  46. 46. Live CardsLow-frequency rendering // Get an instance of a live card liveCard = new LiveCard(this, LIVE_CARD_TAG); ! // Inflate a layout into a remote view liveCardView = new RemoteViews(getPackageName(), R.layout.selling_view); ! // Publish the live card liveCard.publish(PublishMode.REVEAL); ! // Queue the update text runnable handler.post(mUpdateLiveCardRunnable);
  47. 47. GitHub https://github.com/everywaretech/BreakingGlass
  48. 48. Everyware Technologies Thanks! Questions? @tomasruizlopez @everywaretech

×