Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Michał Tajchert - Android Wear Deep Dive
Search
Riga Dev Day
January 30, 2015
Programming
38
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Michał Tajchert - Android Wear Deep Dive
Riga Dev Day
January 30, 2015
More Decks by Riga Dev Day
See All by Riga Dev Day
Faster Java by Adding Structs (Sort Of)
rigadevday
0
170
Prepare for JDK 9! by Dalibor Topic
rigadevday
0
150
Little Important Things in Distributed Architectures by Andres Jaan Tack
rigadevday
0
150
Oracle 12c for Developers by Alex Nuijten
rigadevday
1
140
The Language of Regular Expressions. So You Think You Can Speak It? by Rustam Mehmandarov
rigadevday
0
78
Modern Java Component Design with Spring 4.3 by Juergen Hoeller
rigadevday
0
270
Open Source and OpenJDK: Do They Deliver? by Simon Ritter
rigadevday
0
72
Google Apps Integration in Oracle Apex by Richard Martens
rigadevday
0
300
Integration Testing from the Trenches by Nicolas Fränkel
rigadevday
0
240
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
850
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
270
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
780
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.6k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
2
620
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
230
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
110
A2UI という光を覗いてみる
satohjohn
1
130
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
120
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
230
net-httpのHTTP/2対応について
naruse
0
480
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
Featured
See All Featured
Design in an AI World
tapps
1
240
Navigating Weather and Climate Data
rabernat
0
220
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Documentation Writing (for coders)
carmenintech
77
5.4k
A Tale of Four Properties
chriscoyier
163
24k
Claude Code のすすめ
schroneko
67
230k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Building an army of robots
kneath
306
46k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
250
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Transcript
Android Wear Deep Dive Michał Tajchert Polidea, Software Engineer
Michał Tajchert Android dev in Polidea Warsaw GDG Gadget freak
None
Notifications
Notifications Simplicity Context Extension
Actions
Actions NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_event) .setContentTitle(eventTitle) .setContentText(eventLocation) .setContentIntent(viewPendingIntent)
.addAction(R.drawable.ic_map, “Map Title”, mapPendingIntent);
None
Notification stack NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_event) .setContentTitle(eventTitle) .setContentText(eventLocation)
.setContentIntent(viewPendingIntent) .setGroup(“group_unique_name”)
NotificationCompat.WearableExtender
Notification NotificationCompat.WearableExtender wearableExtender = new NotificationCompat. WearableExtender() .setHintHideIcon(true) .setBackground(mBitmap); NotificationCompat.Builder
notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_event) .setContentTitle(eventTitle) .setContentText(eventLocation) .setContentIntent(viewPendingIntent) .extend(wearableExtender);
Background 400x400 px or 640x400 px
Drawables res/drawables-nodpi
Voice Actions
Standalone apps!
Standalone app • Offline mode • Custom UI • Access
to sensors (and more) • Background work • ....
APK APK
Mobile Module ? Wear Module
Google Play Services
Data exchanging • DataItem API • Message API
Message API
DataItem API
Data Layer Interfaces interface DataListener { void onDataChanged(DataEventBuffer dataEvents); }
interface MessageListener { void onMessageReceived(MessageEvent messageEvent); } interface NodeListener { void onPeerConnected(Node node); void onPeerDisconnected(Node node); }
Teleport github.com/Mariuxtheone/Teleport
Teleport TeleportClient mTeleportClient = new TeleportClient(this); mTeleportClient.connect(); mTeleportClient.sendMessage("startActivity", null); mTeleportClient.syncInt("myInt",
12345); setOnGetMessageTask(new TeleportService.OnGetMessageTask { @Override protected void onPostExecute(String path) { if (path.equals("startActivity")){ Intent startIntent = new Intent(this, WearActivity.class); startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startIntent); };}
EventBus
BusWear github.com/tajchert/BusWear
EventBus
EventBus
BusWear
EventBus.getDefault().post(parcelableObject, this); EventBus.getDefault().postRemote("text", this); EventBus.getDefault().postLocal(object); protected void onCreate(Bundle savedInstanceState) {
EventBus.getDefault().register(this); } public void onEvent(ParcelableObject parcelableObject){ } public void onEvent(String text){ } BusWear
None
None
None
WearHttp github.com/takahirom/WearHttp
WearHttp new WearGetText(MainActivity.this).get("http://example.com/text.txt", new WearGetText.WearGetCallBack() { @Override public void onGet(String
contents) { mTextView.setText(contents); } @Override public void onFail(final Exception e) { mTextView.setText(e.getMessage()); } });
AndroidWearScripts github.com/tajchert/AndroidWearScripts
AndroidWearScripts adb forward tcp:4444 localabstract:/adb-hub adb connect localhost:4444 adb -s
localhost:4444 <command> ./main.sh <optional Id> ./screenshot.sh ./install.sh <apk_file> ./listPackages.sh ...
Exception handling goo.gl/o46Z1u
Exception handling <service android:name=".wear.service.ErrorService" android:process=":error"/> public class WearableApp extends Application
{ private Thread.UncaughtExceptionHandler mWearUEH = new Thread.UncaughtExceptionHandler() { public void uncaughtException(final Thread thread, final Throwable ex) { //... startService(errorIntent); } }; @Override public void onCreate() { Thread.setDefaultUncaughtExceptionHandler(mWearUEH); } } goo.gl/o46Z1u
Sensors
• Acceleration (m/s2) • Magnetic Field (μT) • Gyroscope (rad/s)
• Proximity (cm) Sensors • Temperature (°C) • Pressure (hPa) • Humidity (%) • Light (lx) • Heartrate
Sensors - calculated • Acceleration (m/s2) • Magnetic Field (μT)
• Gyroscope (rad/s) • Proximity (cm) • Temperature (°C) • Pressure (hPa) • Humidity (%) • Light (lx) • Heartrate • Steps • Significant Motion • Gravity • Linear Acceleration • Vector Rotation (x3)
Magnetic Field - location, field strength
Gyroscope - rate or rotation (rad/s)
None
Continuity
Views
Problem?
WearViewStub
BoxInsetLayout
CircledImageView
DismissOverlayView
DelayedConfirmationView
DelayedConfirmationView
GridViewPager
CardFragment
CardFrame
GridViewPager- has beautiful background with parallax effect Here be dragons...
isRound() - works only with English language. which sometimes disappears.
App that rocks!
RAX79Z
google.com/+MichalTajchert @tajchert github.com/tajchert www.tajchert.pl Michał Tajchert