Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
42
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
150
The Language of Regular Expressions. So You Think You Can Speak It? by Rustam Mehmandarov
rigadevday
0
89
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
79
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
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
150
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
810
ジョジョの世界をXRで再現する
mofurune
0
140
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
350
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Workers Cache を知る
syumai
0
340
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.6k
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.9k
Heart of Swift Concurrency
koher
0
1.2k
Featured
See All Featured
BBQ
matthewcrist
90
10k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
450
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
550
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Why Our Code Smells
bkeepers
PRO
340
58k
WENDY [Excerpt]
tessaabrams
14
40k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
910
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.3k
Balancing Empowerment & Direction
lara
6
1.3k
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