11. GDK: Static Card
// Create with current context
Card mCard = new Card(mContext);
mCard.setText("Esto es una static card");
mCard.setFootnote("Y esto es su footer!");
// Add card to timeline
TimelineManager.from(mContext).insert(mCard);
13. GDK: Live Card
// Create livecard using TimelineManager
mLiveCard = TimelineManager.from(mContext).createLiveCard(LIVE_CARD_SAMPLE_1_TAG);
// Set and save live card remote view to modify it later
mLiveCardRemoveViews = new RemoteViews(getPackageName(), R.layout.livecard1);
mLiveCard.setViews(mLiveCardRemoveViews);
// Publish livecard in REVEAL mode (alternative to SILENT mode)
// Set a PendingIntent to handle livecard actions (like a menu)
Intent intent = new Intent(mContext, MenuActivity.class);
mLiveCard.setAction(PendingIntent.getActivity(mContext, 0, intent, 0));
mLiveCard.publish(LiveCard.PublishMode.REVEAL);
18. GDK: CardScroll
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create array of sample cards to use in the adapter
createCards();
// Create view programmatically
mCardScrollView = new CardScrollView(mContext);
CardScrollAdapter adapter = new MyCardAdapter();
mCardScrollView.setAdapter(adapter);
// Important! Views are NOT active by default
mCardScrollView.activate();
// Set activity view as usual
setContentView(mCardScrollView);
}
private class MyCardAdapter extends CardScrollAdapter {
(...)
public View getView(int position, View convertView,
ViewGroup parent) {
// Cards are able to render themselves
return mCards.get(position).toView();
}
}
19. GDK: Voice Trigger
ok glass,
get directions to…
send a message to…
make a call to…
play music...
ok glass, play music…
which artist?
Voice Trigger Voice Trigger Prompt
23. ¿Qué cosas no puedo hacer?
(Hoy, 20 de Marzo de 2014)
24. No es posible
- Reconocimiento facial
- Submenús de voz
- Reconocimiento de voz offline
- Google Play Services: GCM, Google Maps API v2, new
Location APIs…
- Lanzar apps del teléfono
25. getLiveCard() is now createLiveCard()
- XE12 - 17 Diciembre 2013
- XE11 - 11 Noviembre 2013
- XE10 - 7 Octubre 2013