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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Riga Dev Day
January 30, 2015
Programming
40
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
180
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
83
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
78
Google Apps Integration in Oracle Apex by Richard Martens
rigadevday
0
300
Integration Testing from the Trenches by Nicolas Fränkel
rigadevday
0
250
Other Decks in Programming
See All in Programming
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
200
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
540
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
730
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.8k
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.9k
今さら聞けない .NET CLI
htkym
0
200
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
710
Building a Meta Ray-Ban display app
akkeylab
0
170
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
320
yield再入門 #phpcon
o0h
PRO
0
1.2k
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
390
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1.1k
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
540
Optimizing for Happiness
mojombo
378
71k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
My Coaching Mixtape
mlcsv
0
250
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
350
WENDY [Excerpt]
tessaabrams
11
39k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Leo the Paperboy
mayatellez
8
2.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
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