SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
Developing for Android
Wear
Can Elmas
@can_elmas
Software Development Manager at Monitise MEA (formerly
Pozitron)
Backend and front-end roles in mobile projects since 2007
Currently leading Monitise MEA Android team
2014 - 2015, exciting years for wearable tech
Android Wear, Apple Watch, Nike FuelBand, Pebble,
Jawbone, Fitbit and more
Over 720,000 Android Wear devices shipped in 2014
957,000 Apple Watches on the first day of pre-sales
More than 1 million Pebble sold since 2013
Big players; Motorola, LG, Samsung, Sony, Asus, Tag Heuer
1201 android-wear tagged questions on StackOverflow; 517
for apple-watch*
* data gathered on May the 9th
Numbers
The market is still young
What You Can Do
Get / Set reminders
Track fitness
Voice Search
Start navigation
See weather
Control remote media
Stay connected!
Call a car/taxi
Take a note
Set alarm
Set timer
Start stopwatch
Start/Stop a bike ride
Show heart rate
Show step count
Voice Commands
Voice Commands
Declare your own app-provided voice actions to start
activities
“OK Google, start Lovely App”


<activity

android:name=".MainActivity"

android:label="Lovely App" >

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

≠
Do not port a small version of your
handheld app
The Vision
Suggest Demand
Context Stream Cue Card
The Vision
Launched Automatically
The Vision
Glanceable
The Vision
Suggest and Demand
The Vision
Zero or low interaction
Design Principles
Do not stop user from cooking,
eating, walking, running
Design for big gestures
Think about stream cards first i.e.
notifications-instead-of-apps model
Do one thing, really fast
Google Play Services
No Play Store
Contextual
Notifications
Custom App
Developing for Android Wear
Notifications
Notifications
No additional effort required
Notifications
No additional effort required
however..
Extending Notifications with Wearable Functionality
For a better user experience
Wearable Only Actions
Voice Capabilities
Extra Pages
Android 4.3 (API Level 18) or higher
Android v4 support library (or v13, which includes v4)
400x400 for non-scrolling and 640x400 for parallax
scrolling background images in res/drawable-nodpi
Other non-bitmap resources in res/drawable-hdpi


import android.support.v4.app.NotificationCompat;

import android.support.v4.app.NotificationManagerCompat;

import android.support.v4.app.NotificationCompat.WearableExtender;

Notifications
final int notificationId = 1;

final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text");

NotificationManagerCompat.from(context).notify(notificationId, builder.build());

Notifications
final int notificationId = 1;

final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text");

NotificationManagerCompat.from(context).notify(notificationId, builder.build());

Notifications
final int notificationId = 1;

final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text");

NotificationManagerCompat.from(context).notify(notificationId, builder.build());

Notifications
final int notificationId = 1;

final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text");

NotificationManagerCompat.from(context).notify(notificationId, builder.build());

final int notificationId = 1;



final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text")

.setContentIntent(browserPendingIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.ic_notif_large

));



NotificationManagerCompat.from(context).notify(notificationId, builder.build());
Notifications
final int notificationId = 1;



final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Hello Wearable!")

.setContentText("Sample text")

.setContentIntent(browserPendingIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.ic_notif_large

));



NotificationManagerCompat.from(context).notify(notificationId, builder.build());
Notifications
Extending Notifications : Actions
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("HoverBoard is on sale!")

.setContentText("Check it out!")

.setContentIntent(itemDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_hoverboard2

));



// Handheld only actions

builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));



// Wearable-only actions

final NotificationCompat.WearableExtender wearableExtender = new
NotificationCompat.WearableExtender();



wearableExtender.addAction(

new NotificationCompat.Action(

R.drawable.ic_navigation, 

"Start Navigation", 

navigationIntent(context))

);



builder.extend(wearableExtender);
Extending Notifications : Actions
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("HoverBoard is on sale!")

.setContentText("Check it out!")

.setContentIntent(itemDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_hoverboard2

));



// Handheld only actions

builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));



// Wearable-only actions

final NotificationCompat.WearableExtender wearableExtender = new
NotificationCompat.WearableExtender();



wearableExtender.addAction(

new NotificationCompat.Action(

R.drawable.ic_navigation, 

"Start Navigation", 

navigationIntent(context))

);



builder.extend(wearableExtender);
Extending Notifications : Actions
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("HoverBoard is on sale!")

.setContentText("Check it out!")

.setContentIntent(itemDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_hoverboard2

));



// Handheld only actions

builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));



// Wearable-only actions

final NotificationCompat.WearableExtender wearableExtender = new
NotificationCompat.WearableExtender();



wearableExtender.addAction(

new NotificationCompat.Action(

R.drawable.ic_navigation,

“Nearest Shop",

navigationIntent(context))

);



builder.extend(wearableExtender);
Extending Notifications : Actions
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("HoverBoard is on sale!")

.setContentText("Check it out!")

.setContentIntent(itemDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_hoverboard2

));



// Handheld only actions

builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));



// Wearable-only actions

final NotificationCompat.WearableExtender wearableExtender = new
NotificationCompat.WearableExtender();



wearableExtender.addAction(

new NotificationCompat.Action(

R.drawable.ic_navigation,

"Start Navigation",

navigationIntent(context))

);



builder.extend(wearableExtender);
Extending Notifications : Voice Capabilities
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";



final RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)

.setLabel("Rate the session")

.build();
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";



final RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)

.setLabel("Rate the session")

.setChoices(context.getResources().getStringArray(R.array.reply_choices))

.build();
<string-array name="reply_choices">

<item>It was alright</item>

<item>Not so useful</item>

</string-array>
Extending Notifications : Voice Capabilities
...
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Was the session helpful?")

.setContentIntent(openSessionDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_gdg

));



builder.extend(

new NotificationCompat.WearableExtender()

.addAction(

new NotificationCompat.Action.Builder(

R.drawable.abc_ic_voice_search_api_mtrl_alpha,

"Reply",

openSessionDetailsIntent(context)

).addRemoteInput(remoteInput).build()

)
);
...
Extending Notifications : Voice Capabilities
...
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Was the session helpful?")

.setContentIntent(openSessionDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_gdg

));



builder.extend(

new NotificationCompat.WearableExtender()

.addAction(

new NotificationCompat.Action.Builder(

R.drawable.abc_ic_voice_search_api_mtrl_alpha,

"Reply",

openSessionDetailsIntent(context)

).addRemoteInput(remoteInput).build()

)
);
...
Extending Notifications : Voice Capabilities
...
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Was the session helpful?")

.setContentIntent(openSessionDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_gdg

));



builder.extend(

new NotificationCompat.WearableExtender()

.addAction(

new NotificationCompat.Action.Builder(

R.drawable.abc_ic_voice_search_api_mtrl_alpha,

"Reply",

openSessionDetailsIntent(context)

).addRemoteInput(remoteInput).build()

)
);
...
Extending Notifications : Voice Capabilities
…
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("Was the session helpful?")

.setContentIntent(openSessionDetailsIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_gdg

));



builder.extend(

new NotificationCompat.WearableExtender()

.addAction(

new NotificationCompat.Action.Builder(

R.drawable.abc_ic_voice_search_api_mtrl_alpha,

"Reply",

openSessionDetailsIntent(context)

).addRemoteInput(remoteInput).build()

)

);
….
Extending Notifications : Voice Capabilities
Extending Notifications : Pages
More information without requiring user to open the
app on the handheld
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("New Pancake Recipe!")

.setContentText("Start making now!")

.setContentIntent(openRecipeIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes1

));
Extending Notifications : Pages
final Notification secondPage = new NotificationCompat.Builder(context)

.setContentTitle("Step 1")

.setContentText(RECIPE_STEP_1)

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes2

)).build();



final Notification thirdPage = new NotificationCompat.Builder(context)

.setContentTitle("Step 2")

.setContentText(RECIPE_STEP_2)

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes3

)).build();
builder.extend(

new NotificationCompat.WearableExtender()

.addPage(secondPage)

.addPage(thirdPage)

).build();
Extending Notifications : Pages
final Notification secondPage = new NotificationCompat.Builder(context)

.setContentTitle("Step 1")

.setContentText(RECIPE_STEP_1)

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes2

)).build();



final Notification thirdPage = new NotificationCompat.Builder(context)

.setContentTitle("Step 2")

.setContentText(RECIPE_STEP_2)

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes3

)).build();



builder.extend(

new NotificationCompat.WearableExtender()

.addPage(secondPage)

.addPage(thirdPage)

).build();
Extending Notifications : Pages
builder.extend(

new NotificationCompat.WearableExtender()

.addPage(secondPage)

.addPage(thirdPage)

).build();
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

.setSmallIcon(R.drawable.ic_notif)

.setContentTitle("New Pancake Recipe!")

.setContentText("Start making now!")

.setContentIntent(openRecipeIntent(context))

.setLargeIcon(BitmapFactory.decodeResource(

context.getResources(),

R.drawable.bg_pancakes1

));
. // second page
...
...
. // third page
...
Sometimes notifications are not
enough
not possible with notifications
Custom Wearable Apps
Run directly on the device
Fundamentally same as apps built for handheld but
differ greatly in design and usability
Basically activities with custom layouts
Access to sensors and GPU
Small in size and functionality
Custom Wearable Apps
Different code base, no shared resources, different
applications
Custom notifications issued on the wearable are not synced
with handheld
When the device goes to sleep, activity gets destroyed
No back or home button to exit the app
Swiping from the left edge or Long press on the app
Custom Wearable Apps : Unsupported APIs
android.webkit
android.print
android.app.backup
android.appwidget
android.hardware.usb


dependencies {

...

compile 'com.google.android.support:wearable:1.1.0'

compile 'com.google.android.gms:play-services-wearable:7.3.0'

}

SDK tools 23.0.0 or higher
API 20 or higher
Enable Debug over Bluetooth on both Wearable and
Handheld (Android Wear companion app)
adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444
Custom Wearable Apps : Wearable UI Library
BoxInsetLayout
CardFragment
CircledImageView
CrossFadeDrawable
DelayedConfirmationView
DismissOverlayView
DotsPageIndicator
GridViewPager
GridPagerAdapter
FragmentGridPagerAdapter
WatchViewStub
WearableListView
Custom Wearable Apps : Wearable UI Library
CardFragment
BoxInsetLayout
Custom Wearable Apps : Wearable UI Library
GridViewPager
WearableListView
Sending and Syncing Data
Message API Data API Node API
to sync data
across all Wear devices
great for one way
communication
“fire&forget”
to learn about local
or connected
Nodes
Sending and Syncing Data
Channel API
send large data or
stream data
between two or
more devices
Sending and Syncing Data
Channel API
send large data or
stream data
between two or
more devices
Sending and Syncing Data
Capability API
to learn about
capabilities provided
by nodes on the
Wear network
Sending and Syncing Data : Handheld
googleApiClient = new GoogleApiClient.Builder(this)

.addConnectionCallbacks(this)

.addOnConnectionFailedListener(this)

.addApi(Wearable.API)

.build();
@Override

public void onConnected(Bundle bundle) {
sendFlightInfo();

}



@Override

public void onConnectionSuspended(int cause) {

...

}



@Override

public void onConnectionFailed(ConnectionResult connectionResult) {

...

}
@Override

protected void onStart() {

super.onStart();

googleApiClient.connect();

}



@Override

protected void onStop() {

googleApiClient.disconnect();

super.onStop();

}
Sending and Syncing Data : Handheld
@Override

public void onConnected(Bundle bundle) {
sendFlightInfo();

}



@Override

public void onConnectionSuspended(int cause) {

...

}



@Override

public void onConnectionFailed(ConnectionResult connectionResult) {

...

}
@Override

protected void onStart() {

super.onStart();

googleApiClient.connect();

}



@Override

protected void onStop() {

googleApiClient.disconnect();

super.onStop();

}
Sending and Syncing Data : Handheld
private void sendFlightInfo() {



final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");



request.getDataMap().putString("from", "SAW");

request.getDataMap().putString("to", "ESB");

request.getDataMap().putString("gate", "G22");

request.getDataMap().putString("barcode", barcodeData);



Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())

.setResultCallback(new ResultCallback<DataApi.DataItemResult>() {

@Override

public void onResult(DataApi.DataItemResult dataItemResult) {



if (!dataItemResult.getStatus().isSuccess()) {

// handle error

}

}

});



}
Sending and Syncing Data : Handheld
private void sendFlightInfo() {



final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");



request.getDataMap().putString("from", "SAW");

request.getDataMap().putString("to", "ESB");

request.getDataMap().putString("gate", "G22");

request.getDataMap().putString("barcode", barcodeData);



Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())

.setResultCallback(new ResultCallback<DataApi.DataItemResult>() {

@Override

public void onResult(DataApi.DataItemResult dataItemResult) {



if (!dataItemResult.getStatus().isSuccess()) {

// handle error

}

}

});



}
Sending and Syncing Data : Handheld
private void sendFlightInfo() {



final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");



request.getDataMap().putString("from", "SAW");

request.getDataMap().putString("to", "ESB");

request.getDataMap().putString("gate", "G22");

request.getDataMap().putString("barcode", barcodeData);



Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())

.setResultCallback(new ResultCallback<DataApi.DataItemResult>() {

@Override

public void onResult(DataApi.DataItemResult dataItemResult) {



if (!dataItemResult.getStatus().isSuccess()) {

// handle error

}

}

});



}
Sending and Syncing Data : Handheld
private void sendFlightInfo() {



final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");



request.getDataMap().putString("from", "SAW");

request.getDataMap().putString("to", "ESB");

request.getDataMap().putString("gate", "G22");

request.getDataMap().putString("barcode", barcodeData);



Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())

.setResultCallback(new ResultCallback<DataApi.DataItemResult>() {

@Override

public void onResult(DataApi.DataItemResult dataItemResult) {



if (!dataItemResult.getStatus().isSuccess()) {

// handle error

}

}

});



}
Sending and Syncing Data : Handheld
Sending and Syncing Data : Wearable
<service android:name=".datalayerapi.DataLayerListenerService">

<intent-filter>

<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />

</intent-filter>

</service>
public class DataLayerListenerService extends WearableListenerService {



@Override

public void onDataChanged(DataEventBuffer dataEvents) {



for (DataEvent event : dataEvents) {



final DataItem item = event.getDataItem();



if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {



DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();



//raiseLocalBoardingPassNotification(dataMap);

startBoardingPassActivity(dataMap);



}

}

}
...



}

Sending and Syncing Data : Wearable
<service android:name=".datalayerapi.DataLayerListenerService">

<intent-filter>

<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />

</intent-filter>

</service>
public class DataLayerListenerService extends WearableListenerService {



@Override

public void onDataChanged(DataEventBuffer dataEvents) {



for (DataEvent event : dataEvents) {



final DataItem item = event.getDataItem();



if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {



DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();



//raiseLocalBoardingPassNotification(dataMap);

startBoardingPassActivity(dataMap);



}

}

}
...



}

Sending and Syncing Data : Wearable
<service android:name=".datalayerapi.DataLayerListenerService">

<intent-filter>

<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />

</intent-filter>

</service>
public class DataLayerListenerService extends WearableListenerService {



@Override

public void onDataChanged(DataEventBuffer dataEvents) {



for (DataEvent event : dataEvents) {



final DataItem item = event.getDataItem();



if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {



DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();



//raiseLocalBoardingPassNotification(dataMap);

startBoardingPassActivity(dataMap);



}

}

}
...



}

What’s Next and What to Expect?
New Google Play Services 7.3 features; Channel API and
Capability API
WatchFace API
More to check on Data Layer APIs and UI library
Android Wear 5.1 Update; Wi-Fi support, always-on screen,
emojis, gesture controls, new app picker and rapid
contacts
Google IO 15 Sessions
Smarter and personalized device authentication with Smart Lock
Simplifying app development using the wearable support library
Android Wear: Your app and the always-on screen
Resources
https://developer.android.com/training/building-wearables.html
https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-kIrPiq098QH9dOle-fLef
Building Apps for Wearables
DevBytes: Android Wear
Thank You!
@can_elmas
speakerdeck.com/canelmas
github.com/canelmas

Weitere ähnliche Inhalte

Was ist angesagt?

Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your appVitali Pekelis
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdkAlessio Ricco
 
Developing Your First Android Wear App
Developing Your First Android Wear AppDeveloping Your First Android Wear App
Developing Your First Android Wear AppJames Montemagno
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsCodrina Merigo
 
Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Neal Sanche
 
What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?E2LOGY
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wearThomas Oldervoll
 
Developing AIR for Android with Flash Professional CS5
Developing AIR for Android with Flash Professional CS5Developing AIR for Android with Flash Professional CS5
Developing AIR for Android with Flash Professional CS5Chris Griffith
 
Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...将之 小野
 

Was ist angesagt? (16)

Android Wearable App
Android Wearable AppAndroid Wearable App
Android Wearable App
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your app
 
Android wear
Android wearAndroid wear
Android wear
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdk
 
Developing Your First Android Wear App
Developing Your First Android Wear AppDeveloping Your First Android Wear App
Developing Your First Android Wear App
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms Apps
 
Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wear
 
Your First Adobe Flash Application for Android
Your First Adobe Flash Application for AndroidYour First Adobe Flash Application for Android
Your First Adobe Flash Application for Android
 
Developing AIR for Android with Flash Professional CS5
Developing AIR for Android with Flash Professional CS5Developing AIR for Android with Flash Professional CS5
Developing AIR for Android with Flash Professional CS5
 
Android studio
Android studioAndroid studio
Android studio
 
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
 

Ähnlich wie Developing for Android Wear

Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callmaamir farooq
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification TutorialKetan Raval
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Weargabrielemariotti
 
"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila
"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila
"It's Time" - Android Wear codelab - GDG MeetsU - L'AquilaGiuseppe Cerratti
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicskenshin03
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android ProgrammingRaveendra R
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watchCarl Brown
 
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...OPITZ CONSULTING Deutschland
 
8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG GranadaJM Robles
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updatedGhanaGTUG
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionMichelantonio Trizio
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introductionTiziano Basile
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboardmharkus
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...naseeb20
 
Getting Ready For Android Wear
Getting Ready For Android WearGetting Ready For Android Wear
Getting Ready For Android WearRaveesh Bhalla
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentProf. Erwin Globio
 
Android notifications
Android notificationsAndroid notifications
Android notificationsKetan Raval
 

Ähnlich wie Developing for Android Wear (20)

Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification Tutorial
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila
"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila
"It's Time" - Android Wear codelab - GDG MeetsU - L'Aquila
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watch
 
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...
ioS Einstieg und Ausblick - Mobile DevCon Hamburg 2011 - OPITZ CONSULTING - S...
 
8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updated
 
MSR iOS Tranining
MSR iOS TraniningMSR iOS Tranining
MSR iOS Tranining
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introduction
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboard
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
 
Getting Ready For Android Wear
Getting Ready For Android WearGetting Ready For Android Wear
Getting Ready For Android Wear
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android notifications
Android notificationsAndroid notifications
Android notifications
 

Kürzlich hochgeladen

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Kürzlich hochgeladen (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Developing for Android Wear

  • 2. @can_elmas Software Development Manager at Monitise MEA (formerly Pozitron) Backend and front-end roles in mobile projects since 2007 Currently leading Monitise MEA Android team
  • 3. 2014 - 2015, exciting years for wearable tech Android Wear, Apple Watch, Nike FuelBand, Pebble, Jawbone, Fitbit and more Over 720,000 Android Wear devices shipped in 2014 957,000 Apple Watches on the first day of pre-sales More than 1 million Pebble sold since 2013 Big players; Motorola, LG, Samsung, Sony, Asus, Tag Heuer 1201 android-wear tagged questions on StackOverflow; 517 for apple-watch* * data gathered on May the 9th Numbers
  • 4. The market is still young
  • 5.
  • 6. What You Can Do Get / Set reminders Track fitness Voice Search Start navigation See weather Control remote media Stay connected!
  • 7. Call a car/taxi Take a note Set alarm Set timer Start stopwatch Start/Stop a bike ride Show heart rate Show step count Voice Commands
  • 8. Voice Commands Declare your own app-provided voice actions to start activities “OK Google, start Lovely App” 
 <activity
 android:name=".MainActivity"
 android:label="Lovely App" >
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 </activity>

  • 9.
  • 10. Do not port a small version of your handheld app
  • 15. The Vision Zero or low interaction
  • 16. Design Principles Do not stop user from cooking, eating, walking, running Design for big gestures Think about stream cards first i.e. notifications-instead-of-apps model Do one thing, really fast
  • 19.
  • 20.
  • 21.
  • 26. Extending Notifications with Wearable Functionality For a better user experience Wearable Only Actions Voice Capabilities Extra Pages
  • 27. Android 4.3 (API Level 18) or higher Android v4 support library (or v13, which includes v4) 400x400 for non-scrolling and 640x400 for parallax scrolling background images in res/drawable-nodpi Other non-bitmap resources in res/drawable-hdpi 
 import android.support.v4.app.NotificationCompat;
 import android.support.v4.app.NotificationManagerCompat;
 import android.support.v4.app.NotificationCompat.WearableExtender;

  • 28. Notifications final int notificationId = 1;
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text");
 NotificationManagerCompat.from(context).notify(notificationId, builder.build());

  • 29. Notifications final int notificationId = 1;
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text");
 NotificationManagerCompat.from(context).notify(notificationId, builder.build());

  • 30. Notifications final int notificationId = 1;
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text");
 NotificationManagerCompat.from(context).notify(notificationId, builder.build());

  • 31. Notifications final int notificationId = 1;
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text");
 NotificationManagerCompat.from(context).notify(notificationId, builder.build());

  • 32. final int notificationId = 1;
 
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text")
 .setContentIntent(browserPendingIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.ic_notif_large
 ));
 
 NotificationManagerCompat.from(context).notify(notificationId, builder.build()); Notifications
  • 33. final int notificationId = 1;
 
 final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Hello Wearable!")
 .setContentText("Sample text")
 .setContentIntent(browserPendingIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.ic_notif_large
 ));
 
 NotificationManagerCompat.from(context).notify(notificationId, builder.build()); Notifications
  • 34. Extending Notifications : Actions final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("HoverBoard is on sale!")
 .setContentText("Check it out!")
 .setContentIntent(itemDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_hoverboard2
 ));
 
 // Handheld only actions
 builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));
 
 // Wearable-only actions
 final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
 
 wearableExtender.addAction(
 new NotificationCompat.Action(
 R.drawable.ic_navigation, 
 "Start Navigation", 
 navigationIntent(context))
 );
 
 builder.extend(wearableExtender);
  • 35. Extending Notifications : Actions final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("HoverBoard is on sale!")
 .setContentText("Check it out!")
 .setContentIntent(itemDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_hoverboard2
 ));
 
 // Handheld only actions
 builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));
 
 // Wearable-only actions
 final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
 
 wearableExtender.addAction(
 new NotificationCompat.Action(
 R.drawable.ic_navigation, 
 "Start Navigation", 
 navigationIntent(context))
 );
 
 builder.extend(wearableExtender);
  • 36. Extending Notifications : Actions final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("HoverBoard is on sale!")
 .setContentText("Check it out!")
 .setContentIntent(itemDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_hoverboard2
 ));
 
 // Handheld only actions
 builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));
 
 // Wearable-only actions
 final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
 
 wearableExtender.addAction(
 new NotificationCompat.Action(
 R.drawable.ic_navigation,
 “Nearest Shop",
 navigationIntent(context))
 );
 
 builder.extend(wearableExtender);
  • 37. Extending Notifications : Actions final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("HoverBoard is on sale!")
 .setContentText("Check it out!")
 .setContentIntent(itemDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_hoverboard2
 ));
 
 // Handheld only actions
 builder.addAction(R.drawable.ic_add_to_cart, "Add to Cart", addToCartIntent(context));
 
 // Wearable-only actions
 final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
 
 wearableExtender.addAction(
 new NotificationCompat.Action(
 R.drawable.ic_navigation,
 "Start Navigation",
 navigationIntent(context))
 );
 
 builder.extend(wearableExtender);
  • 38. Extending Notifications : Voice Capabilities public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
 
 final RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
 .setLabel("Rate the session")
 .build();
  • 39. public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
 
 final RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
 .setLabel("Rate the session")
 .setChoices(context.getResources().getStringArray(R.array.reply_choices))
 .build(); <string-array name="reply_choices">
 <item>It was alright</item>
 <item>Not so useful</item>
 </string-array> Extending Notifications : Voice Capabilities
  • 40. ... final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Was the session helpful?")
 .setContentIntent(openSessionDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_gdg
 ));
 
 builder.extend(
 new NotificationCompat.WearableExtender()
 .addAction(
 new NotificationCompat.Action.Builder(
 R.drawable.abc_ic_voice_search_api_mtrl_alpha,
 "Reply",
 openSessionDetailsIntent(context)
 ).addRemoteInput(remoteInput).build()
 ) ); ... Extending Notifications : Voice Capabilities
  • 41. ... final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Was the session helpful?")
 .setContentIntent(openSessionDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_gdg
 ));
 
 builder.extend(
 new NotificationCompat.WearableExtender()
 .addAction(
 new NotificationCompat.Action.Builder(
 R.drawable.abc_ic_voice_search_api_mtrl_alpha,
 "Reply",
 openSessionDetailsIntent(context)
 ).addRemoteInput(remoteInput).build()
 ) ); ... Extending Notifications : Voice Capabilities
  • 42. ... final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Was the session helpful?")
 .setContentIntent(openSessionDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_gdg
 ));
 
 builder.extend(
 new NotificationCompat.WearableExtender()
 .addAction(
 new NotificationCompat.Action.Builder(
 R.drawable.abc_ic_voice_search_api_mtrl_alpha,
 "Reply",
 openSessionDetailsIntent(context)
 ).addRemoteInput(remoteInput).build()
 ) ); ... Extending Notifications : Voice Capabilities
  • 43. … final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("Was the session helpful?")
 .setContentIntent(openSessionDetailsIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_gdg
 ));
 
 builder.extend(
 new NotificationCompat.WearableExtender()
 .addAction(
 new NotificationCompat.Action.Builder(
 R.drawable.abc_ic_voice_search_api_mtrl_alpha,
 "Reply",
 openSessionDetailsIntent(context)
 ).addRemoteInput(remoteInput).build()
 )
 ); …. Extending Notifications : Voice Capabilities
  • 44. Extending Notifications : Pages More information without requiring user to open the app on the handheld final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("New Pancake Recipe!")
 .setContentText("Start making now!")
 .setContentIntent(openRecipeIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes1
 ));
  • 45. Extending Notifications : Pages final Notification secondPage = new NotificationCompat.Builder(context)
 .setContentTitle("Step 1")
 .setContentText(RECIPE_STEP_1)
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes2
 )).build();
 
 final Notification thirdPage = new NotificationCompat.Builder(context)
 .setContentTitle("Step 2")
 .setContentText(RECIPE_STEP_2)
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes3
 )).build(); builder.extend(
 new NotificationCompat.WearableExtender()
 .addPage(secondPage)
 .addPage(thirdPage)
 ).build();
  • 46. Extending Notifications : Pages final Notification secondPage = new NotificationCompat.Builder(context)
 .setContentTitle("Step 1")
 .setContentText(RECIPE_STEP_1)
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes2
 )).build();
 
 final Notification thirdPage = new NotificationCompat.Builder(context)
 .setContentTitle("Step 2")
 .setContentText(RECIPE_STEP_2)
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes3
 )).build();
 
 builder.extend(
 new NotificationCompat.WearableExtender()
 .addPage(secondPage)
 .addPage(thirdPage)
 ).build();
  • 47. Extending Notifications : Pages builder.extend(
 new NotificationCompat.WearableExtender()
 .addPage(secondPage)
 .addPage(thirdPage)
 ).build(); final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
 .setSmallIcon(R.drawable.ic_notif)
 .setContentTitle("New Pancake Recipe!")
 .setContentText("Start making now!")
 .setContentIntent(openRecipeIntent(context))
 .setLargeIcon(BitmapFactory.decodeResource(
 context.getResources(),
 R.drawable.bg_pancakes1
 )); . // second page ... ... . // third page ...
  • 49. not possible with notifications
  • 50. Custom Wearable Apps Run directly on the device Fundamentally same as apps built for handheld but differ greatly in design and usability Basically activities with custom layouts Access to sensors and GPU Small in size and functionality
  • 51. Custom Wearable Apps Different code base, no shared resources, different applications Custom notifications issued on the wearable are not synced with handheld When the device goes to sleep, activity gets destroyed No back or home button to exit the app Swiping from the left edge or Long press on the app
  • 52. Custom Wearable Apps : Unsupported APIs android.webkit android.print android.app.backup android.appwidget android.hardware.usb
  • 53. 
 dependencies {
 ...
 compile 'com.google.android.support:wearable:1.1.0'
 compile 'com.google.android.gms:play-services-wearable:7.3.0'
 }
 SDK tools 23.0.0 or higher API 20 or higher Enable Debug over Bluetooth on both Wearable and Handheld (Android Wear companion app) adb forward tcp:4444 localabstract:/adb-hub adb connect localhost:4444
  • 54. Custom Wearable Apps : Wearable UI Library BoxInsetLayout CardFragment CircledImageView CrossFadeDrawable DelayedConfirmationView DismissOverlayView DotsPageIndicator GridViewPager GridPagerAdapter FragmentGridPagerAdapter WatchViewStub WearableListView
  • 55. Custom Wearable Apps : Wearable UI Library CardFragment BoxInsetLayout
  • 56. Custom Wearable Apps : Wearable UI Library GridViewPager WearableListView
  • 57. Sending and Syncing Data Message API Data API Node API to sync data across all Wear devices great for one way communication “fire&forget” to learn about local or connected Nodes
  • 58. Sending and Syncing Data Channel API send large data or stream data between two or more devices
  • 59. Sending and Syncing Data Channel API send large data or stream data between two or more devices
  • 60. Sending and Syncing Data Capability API to learn about capabilities provided by nodes on the Wear network
  • 61. Sending and Syncing Data : Handheld googleApiClient = new GoogleApiClient.Builder(this)
 .addConnectionCallbacks(this)
 .addOnConnectionFailedListener(this)
 .addApi(Wearable.API)
 .build();
  • 62. @Override
 public void onConnected(Bundle bundle) { sendFlightInfo();
 }
 
 @Override
 public void onConnectionSuspended(int cause) {
 ...
 }
 
 @Override
 public void onConnectionFailed(ConnectionResult connectionResult) {
 ...
 } @Override
 protected void onStart() {
 super.onStart();
 googleApiClient.connect();
 }
 
 @Override
 protected void onStop() {
 googleApiClient.disconnect();
 super.onStop();
 } Sending and Syncing Data : Handheld
  • 63. @Override
 public void onConnected(Bundle bundle) { sendFlightInfo();
 }
 
 @Override
 public void onConnectionSuspended(int cause) {
 ...
 }
 
 @Override
 public void onConnectionFailed(ConnectionResult connectionResult) {
 ...
 } @Override
 protected void onStart() {
 super.onStart();
 googleApiClient.connect();
 }
 
 @Override
 protected void onStop() {
 googleApiClient.disconnect();
 super.onStop();
 } Sending and Syncing Data : Handheld
  • 64. private void sendFlightInfo() {
 
 final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");
 
 request.getDataMap().putString("from", "SAW");
 request.getDataMap().putString("to", "ESB");
 request.getDataMap().putString("gate", "G22");
 request.getDataMap().putString("barcode", barcodeData);
 
 Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())
 .setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
 @Override
 public void onResult(DataApi.DataItemResult dataItemResult) {
 
 if (!dataItemResult.getStatus().isSuccess()) {
 // handle error
 }
 }
 });
 
 } Sending and Syncing Data : Handheld
  • 65. private void sendFlightInfo() {
 
 final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");
 
 request.getDataMap().putString("from", "SAW");
 request.getDataMap().putString("to", "ESB");
 request.getDataMap().putString("gate", "G22");
 request.getDataMap().putString("barcode", barcodeData);
 
 Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())
 .setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
 @Override
 public void onResult(DataApi.DataItemResult dataItemResult) {
 
 if (!dataItemResult.getStatus().isSuccess()) {
 // handle error
 }
 }
 });
 
 } Sending and Syncing Data : Handheld
  • 66. private void sendFlightInfo() {
 
 final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");
 
 request.getDataMap().putString("from", "SAW");
 request.getDataMap().putString("to", "ESB");
 request.getDataMap().putString("gate", "G22");
 request.getDataMap().putString("barcode", barcodeData);
 
 Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())
 .setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
 @Override
 public void onResult(DataApi.DataItemResult dataItemResult) {
 
 if (!dataItemResult.getStatus().isSuccess()) {
 // handle error
 }
 }
 });
 
 } Sending and Syncing Data : Handheld
  • 67. private void sendFlightInfo() {
 
 final PutDataMapRequest request = PutDataMapRequest.create("/add-airlines/flight");
 
 request.getDataMap().putString("from", "SAW");
 request.getDataMap().putString("to", "ESB");
 request.getDataMap().putString("gate", "G22");
 request.getDataMap().putString("barcode", barcodeData);
 
 Wearable.DataApi.putDataItem(googleApiClient, request.asPutDataRequest())
 .setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
 @Override
 public void onResult(DataApi.DataItemResult dataItemResult) {
 
 if (!dataItemResult.getStatus().isSuccess()) {
 // handle error
 }
 }
 });
 
 } Sending and Syncing Data : Handheld
  • 68. Sending and Syncing Data : Wearable <service android:name=".datalayerapi.DataLayerListenerService">
 <intent-filter>
 <action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
 </intent-filter>
 </service> public class DataLayerListenerService extends WearableListenerService {
 
 @Override
 public void onDataChanged(DataEventBuffer dataEvents) {
 
 for (DataEvent event : dataEvents) {
 
 final DataItem item = event.getDataItem();
 
 if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {
 
 DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();
 
 //raiseLocalBoardingPassNotification(dataMap);
 startBoardingPassActivity(dataMap);
 
 }
 }
 } ...
 
 }

  • 69. Sending and Syncing Data : Wearable <service android:name=".datalayerapi.DataLayerListenerService">
 <intent-filter>
 <action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
 </intent-filter>
 </service> public class DataLayerListenerService extends WearableListenerService {
 
 @Override
 public void onDataChanged(DataEventBuffer dataEvents) {
 
 for (DataEvent event : dataEvents) {
 
 final DataItem item = event.getDataItem();
 
 if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {
 
 DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();
 
 //raiseLocalBoardingPassNotification(dataMap);
 startBoardingPassActivity(dataMap);
 
 }
 }
 } ...
 
 }

  • 70. Sending and Syncing Data : Wearable <service android:name=".datalayerapi.DataLayerListenerService">
 <intent-filter>
 <action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
 </intent-filter>
 </service> public class DataLayerListenerService extends WearableListenerService {
 
 @Override
 public void onDataChanged(DataEventBuffer dataEvents) {
 
 for (DataEvent event : dataEvents) {
 
 final DataItem item = event.getDataItem();
 
 if (item.getUri().getPath().compareTo("/add-airlines/flight") == 0) {
 
 DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();
 
 //raiseLocalBoardingPassNotification(dataMap);
 startBoardingPassActivity(dataMap);
 
 }
 }
 } ...
 
 }

  • 71. What’s Next and What to Expect? New Google Play Services 7.3 features; Channel API and Capability API WatchFace API More to check on Data Layer APIs and UI library Android Wear 5.1 Update; Wi-Fi support, always-on screen, emojis, gesture controls, new app picker and rapid contacts Google IO 15 Sessions Smarter and personalized device authentication with Smart Lock Simplifying app development using the wearable support library Android Wear: Your app and the always-on screen