Google Glass Development

Google Glass Development

Fe087c5a0e898cd95c67973aa97f2067?s=128

David Vávra

May 23, 2014
Tweet

Transcript

  1. 2.
  2. 3.
  3. 4.
  4. 5.
  5. 6.
  6. 7.
  7. 8.
  8. 9.
  9. 10.
  10. 11.
  11. 12.
  12. 13.
  13. 14.
  14. 15.
  15. 21.
  16. 24.
  17. 25.
  18. 26.

    GDK • Full API level 19 • no touch •

    resolution 640x360 • no emulator • same API for Speech, Camera, Navigation, Browser, Location, Sensors
  19. 27.
  20. 29.

    Card card1 = new Card(context); card1.setText("This card has a footer.");

    card1.setFootnote("I'm the footer!"); View card1View = card1.getView();
  21. 30.

    res/xml/my_voice_trigger.xml <?xml version="1.0" encoding="utf-8"?> <trigger keyword="start my app" /> <uses-permission

    android:name="com.google.android.glass.permission. DEVELOPMENT"/> <activity | service ...> <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 | service> AndroidManifest.xml
  22. 31.
  23. 32.

    Menu The same onCreateOptionsMenu from Android SDK public class MainActivity

    extends Activity { // ... @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { openOptionsMenu(); return true; } return super.onKeyDown(keyCode, event); } }
  24. 33.
  25. 34.

    Creating live cards TimelineManager tm = TimelineManager.from(context); mLiveCard = tm.createLiveCard(LIVE_CARD_TAG);

    mLiveCard.setViews(new RemoteViews(context.getPackageName(), R.layout.card_text)); mLiveCard.publish(LiveCard.PublishMode.REVEAL); // or SILENT
  26. 38.