Download - Hello, Android Wear!
Hello, Android Wear!
+FrederikSchweiger | @flschweiger
Design and build apps for wearables.
Suggest.Be aware of the user’s context ( time, location, physical activity ) and proactively display the currently needed information.
NotificationCompat.WearableExtender wearableExtender =
new NotificationCompat.WearableExtender()
.setHintHideIcon(true)
.setBackground(mBitmap)
.addPage(mySecondPageNotification);
WearableExtenderNotificationService.java
// Extend the notification builder with the second page
Notification notification = notificationBuilder
.extend(wearableExtender)
.build();
WearableExtenderNotificationService.java
Simple.
The Wearable UI Librarydependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
WearableListView CircledImageView ConfirmationActivity ...and many more!
<activity android:name="MyNoteActivity">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="com.google.android.voicesearch.SELF_NOTE" />
</intent-filter>
</activity>
“OK Google, take a note” “OK Google, note to self” “OK Google, call me a taxi”
System-providedAndroidManifest.xml
<application>
<activity
android:name=".MainTimerActivity"
android:label="Timer" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
“OK Google, start Timer”
App-providedAndroidManifest.xml
private static final int SPEECH_REQUEST_CODE = 0;
// Create an intent that can start the Speech Recognizer activity
private void displaySpeechRecognizer() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
// Start the activity, the intent will be populated with the speech text
startActivityForResult(intent, SPEECH_REQUEST_CODE);
}
Free-form Speech InputMainActivity.java
Thanks!
+FrederikSchweiger | @flschweiger
Feel free to circle me on Google+ and send me your questions! You will find the slides in my Google+ stream.