SlideShare a Scribd company logo
1 of 77
Download to read offline
Android Wear Development
Johnny Sung
2015.01.28 @ Android Taipei
Friday, January 30, 15
https://fb.com/j796160836
Johnny Sung
Mobile devices Developer
https://plus.google.com/+JohnnySung
http://about.me/j796160836
Friday, January 30, 15
Agenda
• Overview
• Basic Setup
• Notifications
• Layout
• Data Layer
• Comparison with WatchKit
Friday, January 30, 15
http://www.droid-life.com/wp-content/uploads/2014/03/android-wear.png
https://www.youtube.com/watch?v=CZrGDo9Grgk (30sec)
https://www.youtube.com/watch?v=QrqZl2QIz0c (1.5min)
TVCF
Friday, January 30, 15
http://img1.lesnumeriques.com/news/33/33684/gg-android-wear-tag.jpg
Friday, January 30, 15
Android Wear 設計理念
• Launched automatically (⾃自動啟動)
• Glanceable (可⼀一眼瞥⾒見)
• All about suggest and demand (推薦與需求)
• Zero or low interaction (盡可能減少點擊滑動步驟)
Friday, January 30, 15
http://core0.staticworld.net/images/article/2014/06/android_wear_sports_score-100314393-orig.jpg
Friday, January 30, 15
http://i2.tudocdn.net/img/type28/width646/height284/id106674.jpg
Friday, January 30, 15
Basic setup
Friday, January 30, 15
Debugging over Bluetooth
• ⼿手機設定 Debugging over bluetooth
• ⼿手錶設定 ADB Debug
& Debugging over bluetooth
• 執⾏行 ConnectDebugWear.sh
https://gist.github.com/j796160836/9b135a8de4c44846fd82
Friday, January 30, 15
Debugging over Bluetooth
Friday, January 30, 15
https://www.youtube.com/watch?v=q3a2fdTy_6A
Connect use USB?
Friday, January 30, 15
Android Wear Emulator
& Phone Emulator
Friday, January 30, 15
Android Wear Emulator
& Phone Emulator
• Choose x86 Emulator (faster)
• Install Google Search (2min)
com.google.android.googlequicksearchbox-3.6.16.1614640.x86.apk
• Install Android Wear (2min)
com.google.android.wearable.app
• Be patient
Friday, January 30, 15
Friday, January 30, 15
WearHost for Genymotion
• Install ARM Translation Installer
Genymotion-ARM-Translation_v1.1.zip
• Install GApps
gapps-lp-20141109-signed.zip
gapps-kk-20140606-signed.zip
gapps-jb-20130813-signed.zip
• Install Google Search
com.google.android.googlequicksearchbox
• Install Android Wear
com.google.android.wearable.app
• Run Script: ConnectWearEmulator.sh
https://gist.github.com/j796160836/91e77ca819c11ed7bf01
Friday, January 30, 15
Eclipse user?
Friday, January 30, 15
Compile Wear in Eclipse
• Install Google Repository in SDK Manager
• Find wearable-1.1.0.aar in SDK
android-sdks/extras/google/m2repository/com/google/android/support/
wearable/1.0.0/wearable-1.1.0.aar
• Rename aar to zip and unzip it
• Import from existing code
• Check it Is Library
• Import google-play-service-lib
https://medium.com/@tangtungai/ef1b34126a5d
Friday, January 30, 15
Compile Wear in Android Studio
• Edit Gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.1.0'
compile 'com.google.android.gms:play-services-wearable:6.5.87'
}
[Wearable module]
Friday, January 30, 15
Packaging structure
Android App
Android App
Code
Resources
Code
Resources
Wear App
WearApp Module HandledApp Module
Friday, January 30, 15
Packaging Wearables using Ant
1. Export and Sign Wearable Apps APK
(eg: demowearapp.apk)
2. Add a meta-data tag in AndroidManifest.xml
3. Put your wearable binary in res/raw directory
(eg: res/raw/demowearapp.apk)
4. Write reference descriptions xml
(eg: res/xml/wearable_app_desc.xml)
5. Turn off Asset Compression
https://developer.android.com/training/wearables/apps/packaging.html#PackageManually
https://medium.com/@tangtungai/ef1b34126a5d
Friday, January 30, 15
Packaging Wearables in Eclipse
1. Export and Sign Wearable Apps APK
(eg: demowearapp.apk)
#!/bin/bash
cd ../wearable-1.1.0
android update lib-project --path .
ant clean release
cd ../DemoWearApp
android update project --path .
ant clean release
key.store=TEST.keystore
key.store.password=PASSWORD
key.alias=KEYSTORE_ALIAS
key.alias.password=PASSWORD
config.logging=true
ant.properties
Generate build.xml
[Wearable project]
Friday, January 30, 15
Packaging Wearables in Eclipse
2. Add a meta-data tag in AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- ... -->
<meta-data
android:name="com.google.android.wearable.beta.app"
android:resource="@xml/wearable_app_desc" />
</application>
[Smartphone project]
Friday, January 30, 15
Packaging Wearables in Eclipse
3. Put your wearable binary in res/raw directory
(eg: res/raw/demowearapp.apk)
4. Write reference descriptions xml
(eg: res/xml/wearable_app_desc.xml)
<?xml version="1.0" encoding="utf-8"?>
<wearableApp package="com.example.demowearapp">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>demowearapp</rawPathResId>
</wearableApp>
[Smartphone project]
Friday, January 30, 15
Packaging Wearables in Eclipse
5. Turn off Asset Compression
<target name="-package-resources" depends="-crunch">
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress extension="apk" />
</aapt>
</do-only-if-not-library>
</target>
http://stackoverflow.com/questions/7937368/how-to-pass-arguments-to-aapt-when-building-android-apk
From <sdks_dir>/tools/ant/build.xml, search -package-resources
Add this
[Smartphone project]
Friday, January 30, 15
[Smartphone module]
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
wearApp project(':wear')
}
Packaging Wearables in Android Studio
• Edit Gradle
Friday, January 30, 15
Code Examples
AndroidWearable-Samples
http://goo.gl/q8qfm8
DemoWearApp
http://goo.gl/pIJzr4
Friday, January 30, 15
Notifications
Friday, January 30, 15
世新廣播電
Personal Works
Friday, January 30, 15
Shih Hsin Radio Station
• Actions
• WearableExtender
• Background
• Page
Friday, January 30, 15
Notification 整理
• Notification 到底要怎麼發?
• 從⼿手機發送
• 同步到⼿手錶(含變更樣式)
• 不同步到⼿手錶
• 從⼿手錶發送
mBuilder.setLocalOnly(true);
Friday, January 30, 15
Notification 整理
• Notification 變更樣式?
• 從⼿手機發送
• 設定⼿手機樣式,再變更⼿手錶樣式
• ⾃自訂樣式(只適⽤用於⼿手機)
• 從⼿手錶發送
• ⾃自訂樣式(只適⽤用於⼿手錶)
WearableExtender
WearableExtender
setDisplayIntent
RemoteView
Friday, January 30, 15
基本款 Notification
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.ic_launcher);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText("The description");
Notification notification = mBuilder.build();
int NOTIFICATION_ID = 0x01;
NotificationManager mNotificationManager
	 = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(NOTIFICATION_ID, notification);
建⽴立
發送
Friday, January 30, 15
Notification notification
= new Notification(R.drawable.ic_launcher,
	 	 "New Notification!", System.currentTimeMillis());
notification.setLatestEventInfo(this
, "Awesome app"
, "The description", pending);
基本款 Notification
舊寫法 (deprecated	
  in	
  API	
  level	
  11)
拜託別再寫了哈~
Friday, January 30, 15
基本款 Notification
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.ic_launcher);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText("The description");
Notification notification = mBuilder.build();
Friday, January 30, 15
Android	
  4.1	
  (API	
  16)
BigTextStyle
String msg = ""The quick brown fox …";
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.ic_launcher);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText(msg);
mBuilder.setStyle(
new NotificationCompat.BigTextStyle()
.bigText(msg));
Notification notification = mBuilder.build();
http://developer.android.com/training/notify-user/expanded.html
Friday, January 30, 15
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.photo);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText("The description");
Bitmap bg = BitmapFactory.decodeResource(
getResources(), R.drawable.bg);
NotificationCompat.BigPictureStyle style
= new NotificationCompat.BigPictureStyle();
style.bigPicture(bg);
style.setBigContentTitle("My title");
style.setSummaryText("The description");
mBuilder.setStyle(style);
Notification notification = mBuilder.build();
BigPictureStyle Android	
  4.1	
  (API	
  16)
Friday, January 30, 15
Notification Height Limit
• Normal view layouts: 64 dp
• Expanded view layouts: 256 dp.
256dp
64dp
Friday, January 30, 15
WearableExtender
Friday, January 30, 15
基本款 Notification + 背景
• Background size
• 400 x 400
• 640 x 400 (Parallax scrolling)
• Put the picture at /res/drawable-nodpi
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.photo);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText("The description");
Bitmap bg = BitmapFactory.decodeResource(
getResources(), R.drawable.bg);
NotificationCompat.WearableExtender wearExt
= new NotificationCompat.WearableExtender()
.setBackground(bg);
mBuilder.extend(wearExt);
Notification notification = mBuilder.build();
Friday, January 30, 15
RemoteControlClient Android	
  4.0	
  (API	
  14)
METADATA_KEY_ARTIST
Friday, January 30, 15
RemoteControlClient Android	
  4.0	
  (API	
  14)
• Attribute Keys
• METADATA_KEY_ARTIST
• METADATA_KEY_TITLE
• Attribute Keys
• METADATA_KEY_TITLE
• METADATA_KEY_ALBUM
RemoteView
Friday, January 30, 15
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.photo);
mBuilder.setContentTitle("Awesome app");
mBuilder.setContentText("The description");
Intent clickInt = new Intent(MainActivity.this,
SecondActivity.class);
PendingIntent clickPenInt
= PendingIntent.getActivity(this, 0,
	 clickInt, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(clickPenInt);
Notification notification = mBuilder.build();
按鈕按下的⾏行為
Friday, January 30, 15
24dp
48dp
The Problem is…
Friday, January 30, 15
NotificationCompat.Builder mBuilder
= new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.ic_launcher);
mBuilder.setContentTitle("世新廣播電臺");
mBuilder.setContentText("⼤大⾃自然守護者...");
mBuilder.addAction(new NotificationCompat.Action
(R.drawable.cancel, "Dismiss", dismissPenInt));
mBuilder.addAction(new NotificationCompat.Action
(R.drawable.listen, "Listen FM", listenPenInt));
NotificationCompat.WearableExtender wExt
= new NotificationCompat.WearableExtender();
wExt.addAction(new NotificationCompat.Action
(R.drawable.listen_wear,
"Listen FM",listenPenInt));
Notification notification = mBuilder.build();
http://stackoverflow.com/questions/25026616/android-wear-action-
item-icon-sizing-vs-phone-notification-action-item-sizing
The solutions
Friday, January 30, 15
Code Examples
Wearable Notifications
https://github.com/googlesamples/android-Notifications
Basic Notifications
https://github.com/googlesamples/android-BasicNotifications
Custom Notifications
https://github.com/googlesamples/android-CustomNotifications
Friday, January 30, 15
• WatchViewStub
• 指定 Round layout
• 指定 Rect layout
• BoxInsetLayout
• 設定 app:layout_box="all"
Layout
http://developer.android.com/training/wearables/ui/layouts.html
Friday, January 30, 15
Layout
• Card
• 繼承 CardFragment
• CardScrollView + CardFrame
http://developer.android.com/training/wearables/ui/cards.html
Friday, January 30, 15
UI Structure
Friday, January 30, 15
Data Layer
Friday, January 30, 15
Google	
  Play	
  Services
Friday, January 30, 15
Bluetooth
Mini
Friday, January 30, 15
Data Layer 資料傳輸層
• DataApi
• MessageApi
• NodeApi
Friday, January 30, 15
Data Items
• Path
唯⼀一的字符串,必須以正斜線開始
例如:/path/to/data
• Payload
⼀一個字節數組,你可允許進⾏行對象的序列化
(Serialize) 與反序列化 (Deserialize)
⼤大⼩小不能超過100KB。
PathPayload
100KB
Friday, January 30, 15
連接⽅方式
• 在 Activity 中建⽴立連線,實作 Callback 監聽
• 使⽤用 WearableListenerService
• Callback
• DataApi.DataListener
• MessageApi.MessageListener
• NodeApi.NodeListener
Friday, January 30, 15
Listener
• DataApi.DataListener
• NodeApi.NodeListener
• MessageApi.MessageListener
public void onPeerConnected(Node node)
public void onPeerDisconnected(Node node)
public void onDataChanged(DataEventBuffer dataEvents)
public void onMessageReceived(MessageEvent messageEvent)
Friday, January 30, 15
連接⽅方式
• onCreate() 建⽴立 GoogleApiClient,掛載 Callbacks
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
Friday, January 30, 15
連線 Callback
public void onConnected(Bundle connectionHint)
public void onConnectionFailed(ConnectionResult result)
• GoogleApiClient.ConnectionCallbacks
• GoogleApiClient.OnConnectionFailedListener
public void onConnectionSuspended(int cause)
https://developer.android.com/google/auth/api-client.html
Friday, January 30, 15
連接⽅方式
• onStart() 呼叫 connect() 做連線
@Override
protected void onStart() {
super.onStart();
if (!mResolvingError) {
mGoogleApiClient.connect();
}
}
@Override //ConnectionCallbacks
public void onConnected(Bundle connectionHint) {
Log.d(TAG, "Google API Client was connected");
mResolvingError = false;
Wearable.DataApi.addListener(mGoogleApiClient, this);
Wearable.MessageApi.addListener(mGoogleApiClient, this);
Wearable.NodeApi.addListener(mGoogleApiClient, this);
}
• onConnected() 時候,掛載 Listener
Friday, January 30, 15
@Override
protected void onStop() {
if (!mResolvingError) {
Wearable.DataApi.removeListener(mGoogleApiClient, this);
Wearable.MessageApi.removeListener(mGoogleApiClient, this);
Wearable.NodeApi.removeListener(mGoogleApiClient, this);
mGoogleApiClient.disconnect();
}
super.onStop();
}
連接⽅方式
• onStop() 移除Listener,並且斷線
Friday, January 30, 15
WearableListenerService
• 在系統需要的時候就會⾃自動綁定
<service
android:name=".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) {
	 // Do Somthing
}
@Override
public void onMessageReceived(MessageEvent messageEvent) {
	 // Do Somthing
}
}
AndroidManifest.xml
Friday, January 30, 15
DataApi
http://android-wear-docs.readthedocs.org/en/latest/data.html
Friday, January 30, 15
DataItem
private void sendSampleDataItem() {
final PutDataMapRequest putRequest = PutDataMapRequest.create("/SAMPLE");
final DataMap map = putRequest.getDataMap();
map.putInt("num", 12345);
map.putString("example", "Sample String");
Wearable.DataApi.putDataItem(mGoogleApiClient, putRequest.asPutDataRequest());
}
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
dataEvents.close();
for(DataEvent event : events) {
String path = event.getDataItem().getUri().getPath();
if(path.equals("/SAMPLE")) {
final DataMap map = DataMapItem.fromDataItem(event.getDataItem()).getDataMap();
// read your values from map:
int num = map.getInt("num");
String str = map.getString(“example");
Log.v(TAG, " num = " + num + " str = " + str);
}
}
}
• 傳送
• 接收
Friday, January 30, 15
MessageApi
http://android-wear-docs.readthedocs.org/en/latest/sync.html
Friday, January 30, 15
String msg = "Sample String";
NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi
	 	 .getConnectedNodes(mGoogleApiClient).await();
for (Node node : nodes.getNodes()) {
	 SendMessageResult result = Wearable.MessageApi.sendMessage(
	 	 	 mGoogleApiClient, node.getId(), "/SAMPLE", msg.getBytes())
	 	 	 .await();
	 if (result.getStatus().isSuccess()) {
	 	 // Success
	 } else {
	 	 // Error
	 }
}
@Override
public void onMessageReceived(MessageEvent messageEvent) {
if (messageEvent.getPath().equals("/SAMPLE")) {
final String message = new String(messageEvent.getData());
// Do Something
}
}
• 傳送Message (AsyncTask)
• 接收Message
Message
Friday, January 30, 15
Code Examples
WearMessageBringFront
http://goo.gl/jdKkHL
WearDataLayerDemo
http://goo.gl/HL84YQ
DataLayer
https://github.com/googlesamples/android-DataLayer
Friday, January 30, 15
vsApple Watch
(WatchKit)
Android Wear
Friday, January 30, 15
Android Wear
WatchKit
Packaging structure
Android App
Android App
Code
Resources
Code
Resources
Wear App
WearApp Module HandledApp Module
Friday, January 30, 15
Android Wear
Google Play ServicesGoogle Play Services
Android Device
Controller
Model
View
Mini
Controller
View
Model
Controller
View
Model
App structure
Android Wear
WatchKit
iOS App
Friday, January 30, 15
好像少講了什麼?
Friday, January 30, 15
震動。
超⾃自然
的
Friday, January 30, 15
震動
<uses-permission android:name="android.permission.VIBRATE" />
Vibrator mVibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
myVibrator.vibrate(100);
AndroidManifest.xml
Friday, January 30, 15
震動
mVibrator.vibrate(new long[]{80, 150, 80, 150, 80, 150}, -1);
Repeat
Pattern
mVibrator.cancel();
震動 Pattern
取消
Friday, January 30, 15
Q & A
Friday, January 30, 15
Troubleshooting: ⼿手錶 Offline 解決⽅方式
• Android Wear (設定 > 應⽤用程式)
1. 停⽤用
2. 清除資料
3. 啟⽤用
• Google Play 服務 (設定 > 應⽤用程式)
1. 清除所有資料(管理空間)
• 硬體
1. 重置⼿手錶
2. ⼿手機重新啟動
http://melix.github.io/blog/2014/10/android-moto360.html
$ adb devices
List of devices attached
dcfbbafd! device
localhost:4444 offline
Friday, January 30, 15
Android Wear
(設定 > 應⽤用程式)
Google Play 服務
(設定 > 應⽤用程式 > 管理空間)
重置 Moto360
Troubleshooting: ⼿手錶 Offline 解決⽅方式
Friday, January 30, 15
Troubleshooting: ⼿手錶 unauthorized 解決⽅方
式
• 請使⽤用 Eclipse 做第⼀一次連接
$ adb devices
List of devices attached
dcfbbafd! device
localhost:4444 unauthorized
Friday, January 30, 15

More Related Content

What's hot

Testing Sucks, But It Doesn't Have To
Testing Sucks, But It Doesn't Have ToTesting Sucks, But It Doesn't Have To
Testing Sucks, But It Doesn't Have ToApkudo
 
Instrumentation 101
Instrumentation 101Instrumentation 101
Instrumentation 101Apkudo
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingMatteo Bonifazi
 
從 Google i/o 2015 看下半年 mobile 應用發展趨勢
從 Google i/o 2015 看下半年 mobile 應用發展趨勢從 Google i/o 2015 看下半年 mobile 應用發展趨勢
從 Google i/o 2015 看下半年 mobile 應用發展趨勢Ascii Huang
 
Building html5 apps using Cordova
Building html5 apps using Cordova Building html5 apps using Cordova
Building html5 apps using Cordova David Voyles
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsVIA Embedded
 
Beginning Android Flash Development - GTUG Edition
Beginning Android Flash Development - GTUG EditionBeginning Android Flash Development - GTUG Edition
Beginning Android Flash Development - GTUG EditionStephen Chin
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
もし青森の女子WebデザイナーがAndroidと出会ったら。
もし青森の女子WebデザイナーがAndroidと出会ったら。もし青森の女子WebデザイナーがAndroidと出会ったら。
もし青森の女子WebデザイナーがAndroidと出会ったら。keiko kudo
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 

What's hot (10)

Testing Sucks, But It Doesn't Have To
Testing Sucks, But It Doesn't Have ToTesting Sucks, But It Doesn't Have To
Testing Sucks, But It Doesn't Have To
 
Instrumentation 101
Instrumentation 101Instrumentation 101
Instrumentation 101
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streaming
 
從 Google i/o 2015 看下半年 mobile 應用發展趨勢
從 Google i/o 2015 看下半年 mobile 應用發展趨勢從 Google i/o 2015 看下半年 mobile 應用發展趨勢
從 Google i/o 2015 看下半年 mobile 應用發展趨勢
 
Building html5 apps using Cordova
Building html5 apps using Cordova Building html5 apps using Cordova
Building html5 apps using Cordova
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
 
Beginning Android Flash Development - GTUG Edition
Beginning Android Flash Development - GTUG EditionBeginning Android Flash Development - GTUG Edition
Beginning Android Flash Development - GTUG Edition
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
もし青森の女子WebデザイナーがAndroidと出会ったら。
もし青森の女子WebデザイナーがAndroidと出会ったら。もし青森の女子WebデザイナーがAndroidと出会ったら。
もし青森の女子WebデザイナーがAndroidと出会ったら。
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 

Viewers also liked

Viewers also liked (10)

Android wear
Android wearAndroid wear
Android wear
 
Android Wear Presentation
Android Wear PresentationAndroid Wear Presentation
Android Wear Presentation
 
Seminar report on Android wear
Seminar report on Android wearSeminar report on Android wear
Seminar report on Android wear
 
Smartwatch presentation
Smartwatch presentationSmartwatch presentation
Smartwatch presentation
 
Android Wear Presentation
Android Wear PresentationAndroid Wear Presentation
Android Wear Presentation
 
Android Wear
Android WearAndroid Wear
Android Wear
 
Android Wear
Android WearAndroid Wear
Android Wear
 
Andriod Lollipop 5.0
Andriod Lollipop 5.0Andriod Lollipop 5.0
Andriod Lollipop 5.0
 
Smart watch
Smart watchSmart watch
Smart watch
 
Library powerpoint
Library powerpointLibrary powerpoint
Library powerpoint
 

Similar to Android Wear Development

Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espressoÉdipo Souza
 
Break Timer: Android-wear introduction and application case-study
Break Timer: Android-wear introduction and application case-studyBreak Timer: Android-wear introduction and application case-study
Break Timer: Android-wear introduction and application case-studyUmair Vatao
 
Build your first wear app
Build your first wear appBuild your first wear app
Build your first wear appfurusin
 
Google analytics
Google analyticsGoogle analytics
Google analyticsSean Tsai
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game developmentWomen In Digital
 
Android testing
Android testingAndroid testing
Android testingBitbar
 
Izumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala StackIzumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala Stack7mind
 
Android101 : Introduksjon til Android
Android101 : Introduksjon til AndroidAndroid101 : Introduksjon til Android
Android101 : Introduksjon til AndroidTruls Jørgensen
 
Scaling mobile testing on AWS: Emulators all the way down
Scaling mobile testing on AWS: Emulators all the way downScaling mobile testing on AWS: Emulators all the way down
Scaling mobile testing on AWS: Emulators all the way downKim Moir
 
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Alina Vilk
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watchCarl Brown
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboardmharkus
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
Eclipse Launching Framework
Eclipse Launching FrameworkEclipse Launching Framework
Eclipse Launching FrameworkKangho Kim
 
Windows service best practice
Windows service best practiceWindows service best practice
Windows service best practiceYu GUAN
 

Similar to Android Wear Development (20)

Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 
Break Timer: Android-wear introduction and application case-study
Break Timer: Android-wear introduction and application case-studyBreak Timer: Android-wear introduction and application case-study
Break Timer: Android-wear introduction and application case-study
 
Build your first wear app
Build your first wear appBuild your first wear app
Build your first wear app
 
Google analytics
Google analyticsGoogle analytics
Google analytics
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Android testing
Android testingAndroid testing
Android testing
 
Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Izumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala StackIzumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala Stack
 
Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
Android101 : Introduksjon til Android
Android101 : Introduksjon til AndroidAndroid101 : Introduksjon til Android
Android101 : Introduksjon til Android
 
Scaling mobile testing on AWS: Emulators all the way down
Scaling mobile testing on AWS: Emulators all the way downScaling mobile testing on AWS: Emulators all the way down
Scaling mobile testing on AWS: Emulators all the way down
 
Android testing part i
Android testing part iAndroid testing part i
Android testing part i
 
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watch
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboard
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Eclipse Launching Framework
Eclipse Launching FrameworkEclipse Launching Framework
Eclipse Launching Framework
 
Windows service best practice
Windows service best practiceWindows service best practice
Windows service best practice
 

More from Johnny Sung

[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023Johnny Sung
 
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023Johnny Sung
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) Johnny Sung
 
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022Johnny Sung
 
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020Johnny Sung
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Johnny Sung
 
談談 Android constraint layout
談談 Android constraint layout談談 Android constraint layout
談談 Android constraint layoutJohnny Sung
 
炎炎夏日學 Android 課程 - Part3: Android app 實作
炎炎夏日學 Android 課程 - Part3: Android app 實作炎炎夏日學 Android 課程 - Part3: Android app 實作
炎炎夏日學 Android 課程 - Part3: Android app 實作Johnny Sung
 
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹Johnny Sung
 
炎炎夏日學 Android 課程 - Part2: Android 元件介紹
炎炎夏日學 Android 課程 - Part2: Android 元件介紹炎炎夏日學 Android 課程 - Part2: Android 元件介紹
炎炎夏日學 Android 課程 - Part2: Android 元件介紹Johnny Sung
 
炎炎夏日學 Android 課程 - Part 0: 環境搭建
炎炎夏日學 Android 課程 - Part 0: 環境搭建炎炎夏日學 Android 課程 - Part 0: 環境搭建
炎炎夏日學 Android 課程 - Part 0: 環境搭建Johnny Sung
 
About Mobile Accessibility
About Mobile AccessibilityAbout Mobile Accessibility
About Mobile AccessibilityJohnny Sung
 
Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Johnny Sung
 
First meet with Android Auto
First meet with Android AutoFirst meet with Android Auto
First meet with Android AutoJohnny Sung
 
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇Johnny Sung
 
[MOPCON 2015] 談談行動裝置的 Accessibility
[MOPCON 2015] 談談行動裝置的 Accessibility[MOPCON 2015] 談談行動裝置的 Accessibility
[MOPCON 2015] 談談行動裝置的 AccessibilityJohnny Sung
 
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇Everything About Bluetooth (淺談藍牙 4.0) - Central 篇
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇Johnny Sung
 
A Quick look at ANCS (Apple Notification Center Service)
A Quick look at ANCS (Apple Notification Center Service)A Quick look at ANCS (Apple Notification Center Service)
A Quick look at ANCS (Apple Notification Center Service)Johnny Sung
 
uPresenter, the story.
uPresenter, the story.uPresenter, the story.
uPresenter, the story.Johnny Sung
 
Android workshop - 02. Glass development 101
Android workshop - 02. Glass development 101Android workshop - 02. Glass development 101
Android workshop - 02. Glass development 101Johnny Sung
 

More from Johnny Sung (20)

[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
 
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
 
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
 
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
 
談談 Android constraint layout
談談 Android constraint layout談談 Android constraint layout
談談 Android constraint layout
 
炎炎夏日學 Android 課程 - Part3: Android app 實作
炎炎夏日學 Android 課程 - Part3: Android app 實作炎炎夏日學 Android 課程 - Part3: Android app 實作
炎炎夏日學 Android 課程 - Part3: Android app 實作
 
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
 
炎炎夏日學 Android 課程 - Part2: Android 元件介紹
炎炎夏日學 Android 課程 - Part2: Android 元件介紹炎炎夏日學 Android 課程 - Part2: Android 元件介紹
炎炎夏日學 Android 課程 - Part2: Android 元件介紹
 
炎炎夏日學 Android 課程 - Part 0: 環境搭建
炎炎夏日學 Android 課程 - Part 0: 環境搭建炎炎夏日學 Android 課程 - Part 0: 環境搭建
炎炎夏日學 Android 課程 - Part 0: 環境搭建
 
About Mobile Accessibility
About Mobile AccessibilityAbout Mobile Accessibility
About Mobile Accessibility
 
Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人
 
First meet with Android Auto
First meet with Android AutoFirst meet with Android Auto
First meet with Android Auto
 
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇
Everything About Bluetooth (淺談藍牙 4.0) - Peripheral 篇
 
[MOPCON 2015] 談談行動裝置的 Accessibility
[MOPCON 2015] 談談行動裝置的 Accessibility[MOPCON 2015] 談談行動裝置的 Accessibility
[MOPCON 2015] 談談行動裝置的 Accessibility
 
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇Everything About Bluetooth (淺談藍牙 4.0) - Central 篇
Everything About Bluetooth (淺談藍牙 4.0) - Central 篇
 
A Quick look at ANCS (Apple Notification Center Service)
A Quick look at ANCS (Apple Notification Center Service)A Quick look at ANCS (Apple Notification Center Service)
A Quick look at ANCS (Apple Notification Center Service)
 
uPresenter, the story.
uPresenter, the story.uPresenter, the story.
uPresenter, the story.
 
Android workshop - 02. Glass development 101
Android workshop - 02. Glass development 101Android workshop - 02. Glass development 101
Android workshop - 02. Glass development 101
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Android Wear Development

  • 1. Android Wear Development Johnny Sung 2015.01.28 @ Android Taipei Friday, January 30, 15
  • 2. https://fb.com/j796160836 Johnny Sung Mobile devices Developer https://plus.google.com/+JohnnySung http://about.me/j796160836 Friday, January 30, 15
  • 3. Agenda • Overview • Basic Setup • Notifications • Layout • Data Layer • Comparison with WatchKit Friday, January 30, 15
  • 6. Android Wear 設計理念 • Launched automatically (⾃自動啟動) • Glanceable (可⼀一眼瞥⾒見) • All about suggest and demand (推薦與需求) • Zero or low interaction (盡可能減少點擊滑動步驟) Friday, January 30, 15
  • 10. Debugging over Bluetooth • ⼿手機設定 Debugging over bluetooth • ⼿手錶設定 ADB Debug & Debugging over bluetooth • 執⾏行 ConnectDebugWear.sh https://gist.github.com/j796160836/9b135a8de4c44846fd82 Friday, January 30, 15
  • 13. Android Wear Emulator & Phone Emulator Friday, January 30, 15
  • 14. Android Wear Emulator & Phone Emulator • Choose x86 Emulator (faster) • Install Google Search (2min) com.google.android.googlequicksearchbox-3.6.16.1614640.x86.apk • Install Android Wear (2min) com.google.android.wearable.app • Be patient Friday, January 30, 15
  • 16. WearHost for Genymotion • Install ARM Translation Installer Genymotion-ARM-Translation_v1.1.zip • Install GApps gapps-lp-20141109-signed.zip gapps-kk-20140606-signed.zip gapps-jb-20130813-signed.zip • Install Google Search com.google.android.googlequicksearchbox • Install Android Wear com.google.android.wearable.app • Run Script: ConnectWearEmulator.sh https://gist.github.com/j796160836/91e77ca819c11ed7bf01 Friday, January 30, 15
  • 18. Compile Wear in Eclipse • Install Google Repository in SDK Manager • Find wearable-1.1.0.aar in SDK android-sdks/extras/google/m2repository/com/google/android/support/ wearable/1.0.0/wearable-1.1.0.aar • Rename aar to zip and unzip it • Import from existing code • Check it Is Library • Import google-play-service-lib https://medium.com/@tangtungai/ef1b34126a5d Friday, January 30, 15
  • 19. Compile Wear in Android Studio • Edit Gradle dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:1.1.0' compile 'com.google.android.gms:play-services-wearable:6.5.87' } [Wearable module] Friday, January 30, 15
  • 20. Packaging structure Android App Android App Code Resources Code Resources Wear App WearApp Module HandledApp Module Friday, January 30, 15
  • 21. Packaging Wearables using Ant 1. Export and Sign Wearable Apps APK (eg: demowearapp.apk) 2. Add a meta-data tag in AndroidManifest.xml 3. Put your wearable binary in res/raw directory (eg: res/raw/demowearapp.apk) 4. Write reference descriptions xml (eg: res/xml/wearable_app_desc.xml) 5. Turn off Asset Compression https://developer.android.com/training/wearables/apps/packaging.html#PackageManually https://medium.com/@tangtungai/ef1b34126a5d Friday, January 30, 15
  • 22. Packaging Wearables in Eclipse 1. Export and Sign Wearable Apps APK (eg: demowearapp.apk) #!/bin/bash cd ../wearable-1.1.0 android update lib-project --path . ant clean release cd ../DemoWearApp android update project --path . ant clean release key.store=TEST.keystore key.store.password=PASSWORD key.alias=KEYSTORE_ALIAS key.alias.password=PASSWORD config.logging=true ant.properties Generate build.xml [Wearable project] Friday, January 30, 15
  • 23. Packaging Wearables in Eclipse 2. Add a meta-data tag in AndroidManifest.xml <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <!-- ... --> <meta-data android:name="com.google.android.wearable.beta.app" android:resource="@xml/wearable_app_desc" /> </application> [Smartphone project] Friday, January 30, 15
  • 24. Packaging Wearables in Eclipse 3. Put your wearable binary in res/raw directory (eg: res/raw/demowearapp.apk) 4. Write reference descriptions xml (eg: res/xml/wearable_app_desc.xml) <?xml version="1.0" encoding="utf-8"?> <wearableApp package="com.example.demowearapp"> <versionCode>1</versionCode> <versionName>1.0</versionName> <rawPathResId>demowearapp</rawPathResId> </wearableApp> [Smartphone project] Friday, January 30, 15
  • 25. Packaging Wearables in Eclipse 5. Turn off Asset Compression <target name="-package-resources" depends="-crunch"> <do-only-if-not-library elseText="Library project: do not package resources..." > <aapt executable="${aapt}" command="package" versioncode="${version.code}" versionname="${version.name}" debug="${build.is.packaging.debug}" manifest="${out.manifest.abs.file}" assets="${asset.absolute.dir}" androidjar="${project.target.android.jar}" apkfolder="${out.absolute.dir}" nocrunch="${build.packaging.nocrunch}" resourcefilename="${resource.package.file.name}" resourcefilter="${aapt.resource.filter}" libraryResFolderPathRefid="project.library.res.folder.path" libraryPackagesRefid="project.library.packages" libraryRFileRefid="project.library.bin.r.file.path" previousBuildType="${build.last.target}" buildType="${build.target}" ignoreAssets="${aapt.ignore.assets}"> <res path="${out.res.absolute.dir}" /> <res path="${resource.absolute.dir}" /> <nocompress extension="apk" /> </aapt> </do-only-if-not-library> </target> http://stackoverflow.com/questions/7937368/how-to-pass-arguments-to-aapt-when-building-android-apk From <sdks_dir>/tools/ant/build.xml, search -package-resources Add this [Smartphone project] Friday, January 30, 15
  • 26. [Smartphone module] dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' wearApp project(':wear') } Packaging Wearables in Android Studio • Edit Gradle Friday, January 30, 15
  • 30. Shih Hsin Radio Station • Actions • WearableExtender • Background • Page Friday, January 30, 15
  • 31. Notification 整理 • Notification 到底要怎麼發? • 從⼿手機發送 • 同步到⼿手錶(含變更樣式) • 不同步到⼿手錶 • 從⼿手錶發送 mBuilder.setLocalOnly(true); Friday, January 30, 15
  • 32. Notification 整理 • Notification 變更樣式? • 從⼿手機發送 • 設定⼿手機樣式,再變更⼿手錶樣式 • ⾃自訂樣式(只適⽤用於⼿手機) • 從⼿手錶發送 • ⾃自訂樣式(只適⽤用於⼿手錶) WearableExtender WearableExtender setDisplayIntent RemoteView Friday, January 30, 15
  • 33. 基本款 Notification NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.ic_launcher); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText("The description"); Notification notification = mBuilder.build(); int NOTIFICATION_ID = 0x01; NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(NOTIFICATION_ID, notification); 建⽴立 發送 Friday, January 30, 15
  • 34. Notification notification = new Notification(R.drawable.ic_launcher, "New Notification!", System.currentTimeMillis()); notification.setLatestEventInfo(this , "Awesome app" , "The description", pending); 基本款 Notification 舊寫法 (deprecated  in  API  level  11) 拜託別再寫了哈~ Friday, January 30, 15
  • 35. 基本款 Notification NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.ic_launcher); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText("The description"); Notification notification = mBuilder.build(); Friday, January 30, 15
  • 36. Android  4.1  (API  16) BigTextStyle String msg = ""The quick brown fox …"; NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.ic_launcher); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText(msg); mBuilder.setStyle( new NotificationCompat.BigTextStyle() .bigText(msg)); Notification notification = mBuilder.build(); http://developer.android.com/training/notify-user/expanded.html Friday, January 30, 15
  • 37. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.photo); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText("The description"); Bitmap bg = BitmapFactory.decodeResource( getResources(), R.drawable.bg); NotificationCompat.BigPictureStyle style = new NotificationCompat.BigPictureStyle(); style.bigPicture(bg); style.setBigContentTitle("My title"); style.setSummaryText("The description"); mBuilder.setStyle(style); Notification notification = mBuilder.build(); BigPictureStyle Android  4.1  (API  16) Friday, January 30, 15
  • 38. Notification Height Limit • Normal view layouts: 64 dp • Expanded view layouts: 256 dp. 256dp 64dp Friday, January 30, 15
  • 40. 基本款 Notification + 背景 • Background size • 400 x 400 • 640 x 400 (Parallax scrolling) • Put the picture at /res/drawable-nodpi NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.photo); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText("The description"); Bitmap bg = BitmapFactory.decodeResource( getResources(), R.drawable.bg); NotificationCompat.WearableExtender wearExt = new NotificationCompat.WearableExtender() .setBackground(bg); mBuilder.extend(wearExt); Notification notification = mBuilder.build(); Friday, January 30, 15
  • 41. RemoteControlClient Android  4.0  (API  14) METADATA_KEY_ARTIST Friday, January 30, 15
  • 42. RemoteControlClient Android  4.0  (API  14) • Attribute Keys • METADATA_KEY_ARTIST • METADATA_KEY_TITLE • Attribute Keys • METADATA_KEY_TITLE • METADATA_KEY_ALBUM RemoteView Friday, January 30, 15
  • 43. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.photo); mBuilder.setContentTitle("Awesome app"); mBuilder.setContentText("The description"); Intent clickInt = new Intent(MainActivity.this, SecondActivity.class); PendingIntent clickPenInt = PendingIntent.getActivity(this, 0, clickInt, PendingIntent.FLAG_UPDATE_CURRENT); mBuilder.setContentIntent(clickPenInt); Notification notification = mBuilder.build(); 按鈕按下的⾏行為 Friday, January 30, 15
  • 45. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); mBuilder.setSmallIcon(R.drawable.ic_launcher); mBuilder.setContentTitle("世新廣播電臺"); mBuilder.setContentText("⼤大⾃自然守護者..."); mBuilder.addAction(new NotificationCompat.Action (R.drawable.cancel, "Dismiss", dismissPenInt)); mBuilder.addAction(new NotificationCompat.Action (R.drawable.listen, "Listen FM", listenPenInt)); NotificationCompat.WearableExtender wExt = new NotificationCompat.WearableExtender(); wExt.addAction(new NotificationCompat.Action (R.drawable.listen_wear, "Listen FM",listenPenInt)); Notification notification = mBuilder.build(); http://stackoverflow.com/questions/25026616/android-wear-action- item-icon-sizing-vs-phone-notification-action-item-sizing The solutions Friday, January 30, 15
  • 46. Code Examples Wearable Notifications https://github.com/googlesamples/android-Notifications Basic Notifications https://github.com/googlesamples/android-BasicNotifications Custom Notifications https://github.com/googlesamples/android-CustomNotifications Friday, January 30, 15
  • 47. • WatchViewStub • 指定 Round layout • 指定 Rect layout • BoxInsetLayout • 設定 app:layout_box="all" Layout http://developer.android.com/training/wearables/ui/layouts.html Friday, January 30, 15
  • 48. Layout • Card • 繼承 CardFragment • CardScrollView + CardFrame http://developer.android.com/training/wearables/ui/cards.html Friday, January 30, 15
  • 53. Data Layer 資料傳輸層 • DataApi • MessageApi • NodeApi Friday, January 30, 15
  • 54. Data Items • Path 唯⼀一的字符串,必須以正斜線開始 例如:/path/to/data • Payload ⼀一個字節數組,你可允許進⾏行對象的序列化 (Serialize) 與反序列化 (Deserialize) ⼤大⼩小不能超過100KB。 PathPayload 100KB Friday, January 30, 15
  • 55. 連接⽅方式 • 在 Activity 中建⽴立連線,實作 Callback 監聽 • 使⽤用 WearableListenerService • Callback • DataApi.DataListener • MessageApi.MessageListener • NodeApi.NodeListener Friday, January 30, 15
  • 56. Listener • DataApi.DataListener • NodeApi.NodeListener • MessageApi.MessageListener public void onPeerConnected(Node node) public void onPeerDisconnected(Node node) public void onDataChanged(DataEventBuffer dataEvents) public void onMessageReceived(MessageEvent messageEvent) Friday, January 30, 15
  • 57. 連接⽅方式 • onCreate() 建⽴立 GoogleApiClient,掛載 Callbacks @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Wearable.API) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); } Friday, January 30, 15
  • 58. 連線 Callback public void onConnected(Bundle connectionHint) public void onConnectionFailed(ConnectionResult result) • GoogleApiClient.ConnectionCallbacks • GoogleApiClient.OnConnectionFailedListener public void onConnectionSuspended(int cause) https://developer.android.com/google/auth/api-client.html Friday, January 30, 15
  • 59. 連接⽅方式 • onStart() 呼叫 connect() 做連線 @Override protected void onStart() { super.onStart(); if (!mResolvingError) { mGoogleApiClient.connect(); } } @Override //ConnectionCallbacks public void onConnected(Bundle connectionHint) { Log.d(TAG, "Google API Client was connected"); mResolvingError = false; Wearable.DataApi.addListener(mGoogleApiClient, this); Wearable.MessageApi.addListener(mGoogleApiClient, this); Wearable.NodeApi.addListener(mGoogleApiClient, this); } • onConnected() 時候,掛載 Listener Friday, January 30, 15
  • 60. @Override protected void onStop() { if (!mResolvingError) { Wearable.DataApi.removeListener(mGoogleApiClient, this); Wearable.MessageApi.removeListener(mGoogleApiClient, this); Wearable.NodeApi.removeListener(mGoogleApiClient, this); mGoogleApiClient.disconnect(); } super.onStop(); } 連接⽅方式 • onStop() 移除Listener,並且斷線 Friday, January 30, 15
  • 61. WearableListenerService • 在系統需要的時候就會⾃自動綁定 <service android:name=".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) { // Do Somthing } @Override public void onMessageReceived(MessageEvent messageEvent) { // Do Somthing } } AndroidManifest.xml Friday, January 30, 15
  • 63. DataItem private void sendSampleDataItem() { final PutDataMapRequest putRequest = PutDataMapRequest.create("/SAMPLE"); final DataMap map = putRequest.getDataMap(); map.putInt("num", 12345); map.putString("example", "Sample String"); Wearable.DataApi.putDataItem(mGoogleApiClient, putRequest.asPutDataRequest()); } @Override public void onDataChanged(DataEventBuffer dataEvents) { final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents); dataEvents.close(); for(DataEvent event : events) { String path = event.getDataItem().getUri().getPath(); if(path.equals("/SAMPLE")) { final DataMap map = DataMapItem.fromDataItem(event.getDataItem()).getDataMap(); // read your values from map: int num = map.getInt("num"); String str = map.getString(“example"); Log.v(TAG, " num = " + num + " str = " + str); } } } • 傳送 • 接收 Friday, January 30, 15
  • 65. String msg = "Sample String"; NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi .getConnectedNodes(mGoogleApiClient).await(); for (Node node : nodes.getNodes()) { SendMessageResult result = Wearable.MessageApi.sendMessage( mGoogleApiClient, node.getId(), "/SAMPLE", msg.getBytes()) .await(); if (result.getStatus().isSuccess()) { // Success } else { // Error } } @Override public void onMessageReceived(MessageEvent messageEvent) { if (messageEvent.getPath().equals("/SAMPLE")) { final String message = new String(messageEvent.getData()); // Do Something } } • 傳送Message (AsyncTask) • 接收Message Message Friday, January 30, 15
  • 68. Android Wear WatchKit Packaging structure Android App Android App Code Resources Code Resources Wear App WearApp Module HandledApp Module Friday, January 30, 15
  • 69. Android Wear Google Play ServicesGoogle Play Services Android Device Controller Model View Mini Controller View Model Controller View Model App structure Android Wear WatchKit iOS App Friday, January 30, 15
  • 72. 震動 <uses-permission android:name="android.permission.VIBRATE" /> Vibrator mVibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); myVibrator.vibrate(100); AndroidManifest.xml Friday, January 30, 15
  • 73. 震動 mVibrator.vibrate(new long[]{80, 150, 80, 150, 80, 150}, -1); Repeat Pattern mVibrator.cancel(); 震動 Pattern 取消 Friday, January 30, 15
  • 74. Q & A Friday, January 30, 15
  • 75. Troubleshooting: ⼿手錶 Offline 解決⽅方式 • Android Wear (設定 > 應⽤用程式) 1. 停⽤用 2. 清除資料 3. 啟⽤用 • Google Play 服務 (設定 > 應⽤用程式) 1. 清除所有資料(管理空間) • 硬體 1. 重置⼿手錶 2. ⼿手機重新啟動 http://melix.github.io/blog/2014/10/android-moto360.html $ adb devices List of devices attached dcfbbafd! device localhost:4444 offline Friday, January 30, 15
  • 76. Android Wear (設定 > 應⽤用程式) Google Play 服務 (設定 > 應⽤用程式 > 管理空間) 重置 Moto360 Troubleshooting: ⼿手錶 Offline 解決⽅方式 Friday, January 30, 15
  • 77. Troubleshooting: ⼿手錶 unauthorized 解決⽅方 式 • 請使⽤用 Eclipse 做第⼀一次連接 $ adb devices List of devices attached dcfbbafd! device localhost:4444 unauthorized Friday, January 30, 15