Přednáška Martina Pelanta o vývoji mobilních aplikacích pro Google Glass se uskutečnila 19.8.2014 ve spolupráci s IDE Prague. Odkaz na FB událost: https://www.facebook.com/events/912995792048693/
13. Development
● Mirror API
o Server side development
o Static cards
● Glass Development Kit
o Offline app that runs on Glass directly
o Live cards & full screen apps (Immersion)
14.
15. Mirror API
● REST
● bootstrap projects for Java, .NET, PHP,
Python, GO, Ruby
● Installation - OAuth 2.0 web page
20. Menu items
● reply (speech input)
● read aloud
● share (sharing contacts)
● get directions
● make a call
● delete
● pin
● custom actions
21. {
"text": "Are you ready for
game night this Saturday?",
"menuItems": [
{
"action": "REPLY"
}
]
...
}
22. Subscriptions
● menu item changes
● location changes
o limit 1 callback per 10 min
Sharing contacts
● like Android intents
● mime-types
● voice commands:
o “take a note”
o “post an update”
34. 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);
}
}
38. 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
39. Updating live cards
mRemoteViews.setTextViewText(R.id.text, "new message");
mLiveCard.setViews(mRemoteViews);
Removing live cards
mLiveCard.unpublish();
Glass can also be your personal trainer with LynxFit app. With all the sensors Glass have they will autiomatically recognize and will count for you the number of squats, sit ups push ups
Another example of what Glass is capable of is Word lens - an app that utilizes the camera of your Glass and provides realtime translations of any text you see in the real world.