Download - Introduction to Android Wear
An Introduction to
+Sebastian MauerAndroid GDEGDG Dublin DevFest, November 1st 2014
#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
RepliesPagesStacks
#androidwear
Notifications
#androidwear
Apps
#androidwear
Send data Custom UI Voice Actions
#androidwear
#androidwear
Node
Data
Message
#androidwear
PendingResult<GetConnectedNodesResult> getConnectedNodes(GoogleApiClient);client);
Method
public interface NodeListener { void onPeerConnected(Node peer); void onPeerDisconnected(Node peer);}
Listener
Node#androidwear
PendingResult<SendMessageResult> sendMessage(GoogleApiClient client, String nodeId, String action, byte[] data);
Method
public interface MessageListener { void onMessageReceived(MessageEvent messageEvent);}
Listener
Message#androidwear
PendingResult<DataItemResult>putDataItem(GoogleApiClient client, PutDataRequest request);
PendingResult<DataItemResult>getDataItem(GoogleApiClient client, Uri uri);
Methods
public interface DataListener { void onDataChanged(DataEventBuffer dataEvents);}
Listener
Data#androidwear
<service android:name=".MyListenerService" ><intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> </intent-filter></service>
Intent Filter
public class MyListenerService extends WearableListenerService { ...}
Service
#androidwear
Send data Custom UI Voice Actions
#androidwear
#androidwear
#androidwear
#androidwear
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:+' compile 'com.google.android.gms:play-services-wearable:+'}
build.gradle
#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
<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>
System provided voice action
#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
<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>
App provided voice action
#androidwear
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);}
Speech Recognizer
#androidwear
Notifications Apps
#androidwear
What’s next?Getting Started with Android Weardeveloper.android.com/wear
Design for Android Weardeveloper.android.com/design/wear
#androidwear
+Sebastian MauerAndroid GDEGDG Dublin DevFest, November 1st 2014
Thanks!Any questions?