狠狠撸

狠狠撸Share a Scribd company logo
An Introduction to 
+Sebastian Mauer 
GDG Dublin DevFest, November 1st 2014 Android GDE
#androidwear
#androidwear
#androidwear
#androidwear
#androidwear
#androidwear
#androidwear
#androidwear
#androidwear
you talk to the 
wearable 
#androidwear
actions 
#androidwear
actions 
#androidwear
the wearable 
talks to you 
actions 
#androidwear
actions 
context 
#androidwear
actions 
context 
#androidwear
#androidwear
Launched automatically 
#androidwear
Glanceable 
#androidwear
Suggest and demand 
#androidwear
Zero or low interaction 
#androidwear
#androidwear
Notifications Apps 
#androidwear
Notifications 
#androidwear
#androidwear
#androidwear
#androidwear 
NO WORK 
REQUIRED
#androidwear
#androidwear 
NO WORK 
REQUIRED
Stacks Pages Replies 
#androidwear
Notifications 
#androidwear
Apps 
#androidwear
Send data Custom UI Voice 
Actions 
#androidwear
#androidwear
Node 
Message 
Data 
#androidwear
Method 
PendingResult<GetConnectedNodesResult> 
getConnectedNodes(GoogleApiClient); 
client); 
Listener 
public interface NodeListener { 
void onPeerConnected(Node peer); 
void onPeerDisconnected(Node peer); 
} 
Node 
#androidwear
Method 
PendingResult<SendMessageResult> 
sendMessage(GoogleApiClient client, String nodeId, String action, byte[] data); 
Listener 
public interface MessageListener { 
void onMessageReceived(MessageEvent messageEvent); 
} 
Message 
#androidwear
Methods 
PendingResult<DataItemResult> 
putDataItem(GoogleApiClient client, PutDataRequest request); 
PendingResult<DataItemResult> 
getDataItem(GoogleApiClient client, Uri uri); 
Listener 
public interface DataListener { 
void onDataChanged(DataEventBuffer dataEvents); 
} 
Data 
#androidwear
Service 
public class MyListenerService extends WearableListenerService { 
... 
} 
Intent Filter 
<service android:name=".MyListenerService" > 
<intent-filter> 
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> 
</intent-filter> 
</service> 
#androidwear
Send data Custom UI Voice Actions 
#androidwear
#androidwear
#androidwear
#androidwear
build.gradle 
dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.google.android.support:wearable:+' 
compile 'com.google.android.gms:play-services-wearable:+' 
} 
#androidwear
#androidwear 
● BoxInsetLayout 
● Card Fragment 
● CircledImageView 
● ConfirmationActivity 
● DismissOverlayView 
● GridViewPager 
● GridPagerAdapter 
● FragmentGridPagerAdapter 
● WatchViewStub
#androidwear 
● BoxInsetLayout 
● Card Fragment 
● CircledImageView 
● ConfirmationActivity 
● DismissOverlayView 
● GridViewPager 
● GridPagerAdapter 
● FragmentGridPagerAdapter 
● WatchViewStub
#androidwear 
● BoxInsetLayout 
● Card Fragment 
● CircledImageView 
● ConfirmationActivity 
● DismissOverlayView 
● GridViewPager 
● GridPagerAdapter 
● FragmentGridPagerAdapter 
● WatchViewStub
#androidwear 
● BoxInsetLayout 
● Card Fragment 
● CircledImageView 
● ConfirmationActivity 
● DismissOverlayView 
● GridViewPager 
● GridPagerAdapter 
● FragmentGridPagerAdapter 
● WatchViewStub
Send data Custom UI Voice 
Actions 
#androidwear
#androidwear
System provided voice action 
<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> 
#androidwear
#androidwear 
● Call a car/taxi 
● Take a note 
● Set alarm 
● Set timer 
● Start/Stop a bike ride 
● Start/Stop a run 
● Start/Stop a workout 
● Show heart rate 
● Show step count
App provided voice action 
<activity android:name="StartRunActivity" android:label="MyRunningApp"> 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.LAUNCHER" /> 
</intent-filter> 
</activity> 
#androidwear
Speech Recognizer 
private void displaySpeechRecognizer() { 
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, 
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); 
startActivityForResult(intent, SPEECH_REQUEST_CODE); 
} 
#androidwear
Notifications Apps 
#androidwear
What’s next? 
Getting Started with Android Wear 
developer.android.com/wear 
Design for Android Wear 
developer.android.com/design/wear 
#androidwear
+Sebastian Mauer 
Thanks! 
Any questions? 
GDG Dublin DevFest, November 1st 2014 Android GDE
Introduction to Android Wear
Introduction to Android Wear

More Related Content

Introduction to Android Wear