SlideShare a Scribd company logo
Android Wear
Créez votre propre Watchface
Florent Champigny
Xebia
AndroidManifest
Déclaré en tant que Service de Wallpaper
permission : android.permission.BIND_WALLPAPER
intent-filter : android.service.wallpaper.WallpaperService
AndroidManifest
Utilise les permissions
com.google.android.permission.PROVIDE_BACKGROUND
android.permission.WAKE_LOCK
AndroidManifest
Déclare les meta-datas
android.service.wallpaper -> xml contenant <wallpaper/>
com.google.android.wearable.watchface.preview -> Drawable
com.google.android.wearable.watchface.preview_circular -> Drawable
CanvasWatchFaceService
public class MyWatchFaceService extends CanvasWatchFaceService {
@Override public Engine onCreateEngine() {
}
}
CanvasWatchFaceService.Engine
void onCreate(SurfaceHolder holder);
void onDestroy();
void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height);
void onTimeTick();
void onVisibilityChanged(boolean visible);
void onDraw(Canvas canvas, Rect bounds);
void onAmbientModeChanged(boolean inAmbientMode);
Ambiant mode
Ambiant
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
(Épaisseur du pinceau)
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
(Lissage de la texture)
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
BUTT
ROUND
SQUARE
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
MITER ROUND BEVEL
Canvas - Paint
Color
StrokeWidth
AntiAlias
StrokeCap
StrokeJoin
ShadowLayer
Style
FILL STROKE STROKE & FILL
Canvas
canvas.drawBitmap( bitmap, left, top, paint);
canvas.drawRect(left, top, right, bottom, paint);
…
canvas.drawRoundRect(left, top, right, bottom, rx, ry, paint);
canvas.drawLine(startX, startY, stopX, stopY, paint);
canvas.drawOval(rect , paint);
canvas.drawCircle(centerX, centerY, radius, paint);
Canvas
canvas.save();
canvas.restore();
canvas.rotate(angle, centerX, centerY);
canvas.translate(dx, dy);
canvas.scale(sx, sy);
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.5f ,0.5f, 1f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1
Canvas
canvas.drawBitmap(background,0,0,p);
canvas.save();
canvas.rotate(90, 0.5f, 0.5f);
canvas.drawRect(0.45f ,0.5f, 0.55f, 1f, p);
canvas.restore();
0 y 1
0
x
1

More Related Content

Viewers also liked

Asal Mula Kehidupan Di Bumi (Alamiah dasar)
Asal Mula Kehidupan Di Bumi (Alamiah dasar)Asal Mula Kehidupan Di Bumi (Alamiah dasar)
Asal Mula Kehidupan Di Bumi (Alamiah dasar)Azier Nadhir
 
Classification of Malocclusion in Orthodontics
Classification of Malocclusion in OrthodonticsClassification of Malocclusion in Orthodontics
Classification of Malocclusion in OrthodonticsOrthodontic Gallery
 
Kekerasaan dalam Rumah Tangga
Kekerasaan dalam Rumah TanggaKekerasaan dalam Rumah Tangga
Kekerasaan dalam Rumah Tanggaangelaxmi
 
Accidentes de trabajo y elementos de un accidente
Accidentes de trabajo    y elementos de un accidenteAccidentes de trabajo    y elementos de un accidente
Accidentes de trabajo y elementos de un accidenteJesus Rangel
 

Viewers also liked (7)

Mohamed sharique (buying and leasing)
Mohamed sharique (buying and leasing)Mohamed sharique (buying and leasing)
Mohamed sharique (buying and leasing)
 
Asal Mula Kehidupan Di Bumi (Alamiah dasar)
Asal Mula Kehidupan Di Bumi (Alamiah dasar)Asal Mula Kehidupan Di Bumi (Alamiah dasar)
Asal Mula Kehidupan Di Bumi (Alamiah dasar)
 
Classification of Malocclusion in Orthodontics
Classification of Malocclusion in OrthodonticsClassification of Malocclusion in Orthodontics
Classification of Malocclusion in Orthodontics
 
Hire purchase
Hire purchaseHire purchase
Hire purchase
 
Kekerasaan dalam Rumah Tangga
Kekerasaan dalam Rumah TanggaKekerasaan dalam Rumah Tangga
Kekerasaan dalam Rumah Tangga
 
prueba
pruebaprueba
prueba
 
Accidentes de trabajo y elementos de un accidente
Accidentes de trabajo    y elementos de un accidenteAccidentes de trabajo    y elementos de un accidente
Accidentes de trabajo y elementos de un accidente
 

Similar to Android wear - watch face

echo-o & Android App Dev - BarCamp Saigon 1
echo-o & Android App Dev - BarCamp Saigon 1echo-o & Android App Dev - BarCamp Saigon 1
echo-o & Android App Dev - BarCamp Saigon 1huyzing
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsVIA Embedded
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear EssentialsNilhcem
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspectiveSebastian Vieira
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Alfredo Morresi
 
Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android nSercan Yusuf
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basicsAnton Narusberg
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)Google
 
Push Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKPush Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKAjay Chebbi
 
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능GDG Korea
 
Android Evolution, AppForum 2014, Brussels, Friedger Müffke
Android Evolution, AppForum 2014, Brussels, Friedger MüffkeAndroid Evolution, AppForum 2014, Brussels, Friedger Müffke
Android Evolution, AppForum 2014, Brussels, Friedger MüffkeFriedger Müffke
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperDroidConTLV
 
Android Lab Test : Using the camera preview (english)
Android Lab Test : Using the camera preview (english)Android Lab Test : Using the camera preview (english)
Android Lab Test : Using the camera preview (english)Bruno Delb
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介easychen
 

Similar to Android wear - watch face (20)

echo-o & Android App Dev - BarCamp Saigon 1
echo-o & Android App Dev - BarCamp Saigon 1echo-o & Android App Dev - BarCamp Saigon 1
echo-o & Android App Dev - BarCamp Saigon 1
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear Essentials
 
Compose In Practice
Compose In PracticeCompose In Practice
Compose In Practice
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspective
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android n
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
 
Camera
CameraCamera
Camera
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
Lightning Talk - Xamarin
Lightning Talk - Xamarin Lightning Talk - Xamarin
Lightning Talk - Xamarin
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Push Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKPush Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDK
 
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
 
Android Evolution, AppForum 2014, Brussels, Friedger Müffke
Android Evolution, AppForum 2014, Brussels, Friedger MüffkeAndroid Evolution, AppForum 2014, Brussels, Friedger Müffke
Android Evolution, AppForum 2014, Brussels, Friedger Müffke
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
 
Android Lab Test : Using the camera preview (english)
Android Lab Test : Using the camera preview (english)Android Lab Test : Using the camera preview (english)
Android Lab Test : Using the camera preview (english)
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 

Recently uploaded

1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptxlouise569794
 
一比一原版Southern Cross毕业证成绩单如何办理
一比一原版Southern Cross毕业证成绩单如何办理一比一原版Southern Cross毕业证成绩单如何办理
一比一原版Southern Cross毕业证成绩单如何办理cnzepoz
 
一比一原版UW毕业证成绩单如何办理
一比一原版UW毕业证成绩单如何办理一比一原版UW毕业证成绩单如何办理
一比一原版UW毕业证成绩单如何办理cnzepoz
 
一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理cnzepoz
 
一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理cnzepoz
 
一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理cnzepoz
 
一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理cnzepoz
 
一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理cnzepoz
 
一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理cnzepoz
 
一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理cnzepoz
 
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...Amil Baba Dawood bangali
 
一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理cnzepoz
 
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...Amil baba
 
一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理cnzepoz
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理kywwoyk
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxArjunJain44
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理cnzepoz
 
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...Amil baba
 
China Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian DiecastChina Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian DiecastAMshares
 
一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理cnzepoz
 

Recently uploaded (20)

1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx
 
一比一原版Southern Cross毕业证成绩单如何办理
一比一原版Southern Cross毕业证成绩单如何办理一比一原版Southern Cross毕业证成绩单如何办理
一比一原版Southern Cross毕业证成绩单如何办理
 
一比一原版UW毕业证成绩单如何办理
一比一原版UW毕业证成绩单如何办理一比一原版UW毕业证成绩单如何办理
一比一原版UW毕业证成绩单如何办理
 
一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理
 
一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理
 
一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理
 
一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理
 
一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理
 
一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理
 
一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理
 
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...
NO1 Pandit Black magic/kala jadu,manpasand shadi in lahore,karachi rawalpindi...
 
一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理
 
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
 
一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptx
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
 
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
 
China Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian DiecastChina Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian Diecast
 
一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理
 

Android wear - watch face