Share
Embed
Don't use it or you'll lose it
Рассмотрим, как можно использовать возможности вашего устройства (в том числе, его сенсоров) и некоторые приемы UX для того, чтобы улучшить производительность и удобство использования вашего приложения.
GDG SPb
September 30, 2017
Transcript
224 slides
-
Don’t use it or you’ll lose it by Royi Benyossef
Battery and network performance -
Android developer since 2009 Tech community activist, speaker and founder
Introduction Royi Benyossef -
Android developer since 2009 Tech community activist, speaker and founder
Mentor at * accelerator Introduction Royi Benyossef -
Android developer since 2009 Tech community activist, speaker and founder
Mentor at * accelerator Google expert since 2013 Introduction Royi Benyossef -
Android developer since 2009 Tech community activist, speaker and founder
Mentor at * accelerator Google expert since 2013 Ecosystem relations manager at Samsung NEXT Tel-Aviv Introduction Royi Benyossef -
Introduction Samsung Next Tel-aviv Software and services startups and products:
- Early stage investments (seed round to round B) -
Introduction Samsung Next Tel-aviv Software and services startups and products:
- Early stage investments (seed round to round B) - Product creation -
Introduction Samsung Next Tel-aviv Software and services startups and products:
- Early stage investments (seed round to round B) - Product creation - M&A -
Introduction Samsung Next Tel-aviv Software and services startups and products:
- Early stage investments (seed round to round B) - Product creation - M&A Contact: [email protected] -
Prologue We use apps everywhere Our desires change based on
the environment What seems to be the problem? -
Prologue We use apps everywhere Our desires change based on
the environment Apps must adapt What seems to be the problem? -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery Users don’t like losing money or battery! -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery Users don’t like losing money or battery! However... -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery Users don’t like losing money or battery! Users want the best UX! the second she wakes up... Does not like waiting! Wants fresh data... -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery Users don’t like losing money or battery! Users want the best UX! Internet is not everywhere!!! -
Prologue Problem example Apps need data Wi-Fi data is free
3G/4G data costs money All of them drain the battery Users don’t like losing money or battery! Users want the best UX! Internet is not everywhere!!! (= Example: metro!) -
Battery Glossary Radio: That thing that connects you to cell
towers • Phone calls + SMS + internet -
Battery Glossary Radio (= internet) Radio baseline mode: Radio’s almost
off • Uses almost no power -
Battery Glossary Radio (= internet) Radio baseline mode: Radio’s almost
off • Uses almost no power (100 mA) -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode: • Radio working at full power -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode: Radio working at full power • POWER!!! (400 mA) -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode (working, needs POWER!!!) Radio idle mode -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode (working, needs POWER!!!) Radio idle mode: Does (almost) nothing • Still uses power -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode (working, needs POWER!!!) Radio idle mode: Does (almost) nothing • Still uses power (300 mA) -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode (working, needs POWER!!!) Radio idle mode: Does (almost) nothing Still uses power (300 mA) • Lasts up to 90 seconds -
Battery Glossary Radio (= internet) Radio baseline mode (does nothing,
uses nothing) Radio download mode (working, needs POWER!!!) Radio idle mode: Does (almost) nothing Still uses power (300 mA) • Lasts up to 90 seconds (!!!) -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: • Phone radio is at “baseline” -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” • App A needs to fetch from server -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server • Radio goes to “download” -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server Radio goes to “download” • Data downloaded -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server Radio goes to “download” Data downloaded • Radio goes to “idle” -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server Radio goes to “download” Data downloaded Radio goes to “idle” • Radio waits 90 seconds (in “idle”) -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server Radio goes to “download” Data downloaded Radio goes to “idle” Radio waits 90 seconds (in “idle”) • Radio goes to “baseline” -
Battery Glossary Radio (= internet, modes = baseline, download, idle)
Workflow: Phone radio is at “baseline” App A needs to fetch from server Radio goes to “download” Data downloaded Radio goes to “idle” Radio waits 90 seconds (in “idle”) Radio goes to “baseline” -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) ... -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket (= 55% battery) -
Battery Real workflow 08:00 - Royi puts phone in pocket
08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket (= 55% battery?!) -
Battery Possible solutions Use the radio less Use the radio
more efficiently -
Battery Let sleeping radios lie Use call batching enabled API
- Letting Android batch calls according to time and urgency -
Battery Let sleeping radios lie Use call batching enabled API
Letting Android batch calls according to time and urgency - Less calls = same data with less idle time = PROFIT! -
Battery Let sleeping radios lie Before batching 08:00 - Royi
puts phone in pocket 08:15 - App A update (every 60 minutes) 09:00 - App B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket -
Battery Let sleeping radios lie After batching 08:00 - Royi
puts phone in pocket 08:15 - App A update (every 60 minutes) 09:00 - App A,B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A,C update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket -
Battery Let sleeping radios lie Use call batching enabled API:
• FCM network manager -
Battery Let sleeping radios lie Use call batching enabled API:
• FCM network manager (requires Google Play Services) -
Battery Let sleeping radios lie Use call batching enabled API:
FCM network manager (requires Google Play Services) • JobScheduler -
Battery Let sleeping radios lie Use call batching enabled API:
FCM network manager (requires Google Play Services) • JobScheduler (requires Android 5.0+) -
Battery Let sleeping radios lie Use call batching enabled API:
FCM network manager (requires Google Play Services) JobScheduler (requires Android 5.0+) • SyncAdapter -
Battery Let sleeping radios lie Use call batching enabled API:
FCM network manager (requires Google Play Services) JobScheduler (requires Android 5.0+) • SyncAdapter (complex implementation) -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications - Push receivers work while radio is at baseline mode -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Push receivers work while radio is at baseline mode - The server notifies you when something changed -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Push receivers work while radio is at baseline mode The server notifies you when something changed - Nothing’s changed, cancel call = no wasted idle and downloading times -
Battery Let sleeping radios lie Before push 08:00 - Royi
puts phone in pocket 08:15 - App A update (every 60 minutes) 09:00 - App A,B update (every day at 09:00) 09:07 - App C update (FCM induced) 09:15 - App A,C update (every 60 minutes) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket -
Battery Let sleeping radios lie After push 08:00 - Royi
puts phone in pocket 08:55 - App A push (FCM induced) 09:00 - App A,B update (every day at 09:00) 09:07 - App C push (FCM induced) 09:15 - App A,C update (batched) 09:35 - App G update (every 2 hours) ... 13:30 - Royi checks the phone in his pocket -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API - Searching for connectivity is more costly than calls -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API Searching for connectivity is more costly than calls - App level queries keeps app loaded and the CPU running -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API Searching for connectivity is more costly than calls App level queries keeps app loaded and the CPU running - Apps rarely use exponential back-off algorithms -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API: • ConnectivityManager -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API: • ConnectivityManager (one batched check for all apps, not keeping app loaded) -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API: ConnectivityManager (one batched check for all apps) • Schedulers -
Battery Let sleeping radios lie Use call batching enabled API
Use FCM push notifications Use system connectivity check API: ConnectivityManager (one batched check for all apps) • Schedulers (use ConMag automatically, use exponential back-off) -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when: • Screen is off -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when: Screen is off • Stationary -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when: Screen is off • Stationary (not moving = on a desk/stand) -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when: Screen is off Stationary (not moving = on a desk/stand) • Not charging -
Battery appendix Doze Was Introduced as part of Lollipop Doze
applies when device is unused & not charging Doze was improved as part of Marshmallow -
Battery appendix Doze Was Introduced as part of Lollipop Doze
applies when device is unused & not charging Doze was improved as part of Marshmallow to detect: • Activity = walking -
Battery appendix Doze Was Introduced as part of Lollipop Doze
applies when device is unused & not charging Doze was improved as part of Marshmallow to detect: Activity = walking • Screen off -
Battery appendix Doze Was Introduced as part of Lollipop Doze
applies when device is unused & not charging Doze was improved as part of Marshmallow to detect: Activity = walking Screen off • Not charging -
Battery appendix Doze Was Introduced as part of Lollipop Doze
applies when device is unused & not charging Doze was improved as part of Marshmallow to detect: • Device is in-pocket/in-bag -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied: • It blocks all network operations -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied: • It blocks all network operations (except for “maintenance windows”) -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied it forces network batching -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied it forces network batching To comply -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied it forces network batching To comply: • Test app while in doze mode -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied it forces network batching To comply: Test app while in doze mode • If applicable - set right priority for AlarmManager -
Battery appendix Doze Was Introduced as part of Lollipop Applies
when device is unused & not charging When applied it forces network batching To comply: Test app while in doze mode • If applicable - set right priority for AlarmManager (=setAndAllowWhileIdle()/setExactAndAllowWhileIdle()) -
Battery appendix Before Doze 23:00 - Royi goes to sleep
00:00 - App B update 01:13 - App E update 02:00 - App C, D update 03:15 - App A update 04:00 - App B, D update 05:30 - Royi checks phone on night stand -
Battery appendix Before Doze 23:00 - Royi goes to sleep
00:00 - App B update 01:13 - App E update 02:00 - App C, D update 03:15 - App A update 04:00 - App B, D update 05:30 - Royi checks phone on night stand 05:31 - Royi is angry because he has 23% battery -
Battery appendix After Doze 23:00 - Royi goes to sleep
00:00 - App B update 01:30 - App B,E update 02:00 - App C, D update 03:15 - App A update 04:00 - App A, B, C, D update 05:30 - Royi checks phone on nightstand -
Battery appendix After Doze 23:00 - Royi goes to sleep
00:00 - App B update 01:30 - App B,E update 02:00 - App C, D update 03:15 - App A update 04:00 - App A, B, C, D update 05:30 - Royi checks phone on nightstand 05:31 - Royi is happy because he has 43% battery -
Network usage Motivation reminder Battery saved by using the radio
more efficiently -
Network usage Motivation reminder Battery saved by using the radio
more efficiently: (= Less calls) -
Network usage Motivation reminder Battery saved by using the radio
more efficiently: (= Less calls = less “radio idle mode time”) -
Network usage Motivation reminder Battery saved by reducing “radio idle
mode time” - Done! -
Network usage Motivation reminder Battery saved by reducing “radio idle
mode time” - Done! To do -
Network usage Motivation reminder Battery saved by reducing “radio idle
mode time” - Done! To do: • Reducing radio download mode time -
Network usage Motivation reminder Battery saved by reducing “radio idle
mode time” - Done! To do: Reducing radio download mode time • Improving UX while reducing radio download time -
Network usage The problem with polling Calling the backend even
if nothing changed -
Network usage The problem with polling Calling the backend even
if nothing changed (+ Idle mode) -
Network usage The problem with polling Calling the backend even
if nothing changed Re-downloading data again and again -
Network usage The problem with polling Calling the backend even
if nothing changed Re-downloading data again and again (+ redundant download mode time) -
Network usage The problem with polling Calling the backend even
if nothing changed Re-downloading data again and again (+ redundant download mode time) (+ wasting data plan) -
Network usage The problem with polling Calling the backend even
if nothing changed Re-downloading data again and again (+ redundant download mode time) (+ wasting data plan) -
Network usage Fetching fetchingly Optimize fetching methods: • Freshness headers
- Far smaller download time footprint -
Network usage Fetching fetchingly Optimize fetching methods: • Freshness headers
Smaller download time footprint - Easy impl. on both client and server -
Network usage Fetching fetchingly Optimize fetching methods: • Freshness headers
Smaller download time footprint Easy impl. - Con: still polling (+ Idle mode time) -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
• Firebase Cloud Messaging push -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
• FCM push: - Good performance -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
• FCM push: - Good performance (= No Idle, No download) -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
• FCM push: Good performance - Harder impl. -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
Medium (push update notification) • Advanced -
Network usage Fetching fetchingly Optimize fetching methods: Easy (freshness headers)
Medium (push update notification) • Advanced (real time databases) -
Network usage Fetching fetchingly Optimize fetching methods Optimize payloads: Diff
only • Gzip compression -
Network usage Fetching fetchingly Optimize fetching methods Optimize payloads: Diff
only Gzip compression • Advanced formats -
Network usage Fetching fetchingly Optimize fetching methods Optimize payloads: Diff
only Gzip compression • Advanced formats (FlatBuffers) -
Network usage Fetching fetchingly Optimize fetching methods Optimize payloads: Diff
only Gzip compression Advanced formats (FlatBuffers) • Segmentation -
Network usage Fetching fetchingly Optimize fetching methods Optimize payloads: Diff
only Gzip compression Advanced formats (FlatBuffers) • Segmentation (paging & indexing) -
Anticipate your users Understand when it’s OK to binge and
when it’s best to be frugal -
Anticipate your users Available data points to consider Misc. device
listeners: • Screen state -
Anticipate your users Available data points to consider Misc. device
listeners: • Screen state (on/off) -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) • Network state -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) • Network state (3G, WiFi, nothing) -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) Network state (3G, WiFi, nothing) • Battery state -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) Network state (3G, WiFi, nothing) • Battery state (OK, low, charging) -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) Network state (3G, WiFi, nothing) Battery state (OK, low, charging) • Dock state -
Anticipate your users Available data points to consider Misc. device
listeners: Screen state (on/off) Network state (3G, WiFi, nothing) Battery state (OK, low, charging) • Dock state (none, car, desk) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: • Activity -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: • Activity (walking, running, cycling, driving, stationary) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) • Location -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) • Location (Lat/Long, Google Places) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) Location (Lat/Long, Google Places) • Physical web -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) Location (Lat/Long, Google Places) • Physical web (Beacons nearby) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) Location (Lat/Long, Google Places) Physical web (Beacons nearby) • Headphones -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) Location (Lat/Long, Google Places) Physical web (Beacons nearby) • Headphones (yes/no) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API: Activity (walking, running, cycling, driving, stationary) Location (Lat/Long, Google Places) Physical web (Beacons nearby) • Headphones (yes/no) - take that iPhone users! -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) - Supported back to Froyo (2.2) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) - *Supported back to Froyo (2.2) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) - *Supported back to Froyo (2.2) *Caution: getBeaconState() is only supported on devices running API level 18 (Jelly Bean) or higher. If calling from a device running an earlier version, getStatus() will return status code API_NOT_AVAILABLE. -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) - Permissions: - Beacons & location = FINE_LOCATION -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) - Permissions: Beacons & location = FINE_LOCATION - Activity = ACTIVITY_RECOGNITION -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) - Permissions: Beacons & location = FINE_LOCATION Activity = ACTIVITY_RECOGNITION - Headphones & time = NONE -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) Permissions needed - Outputs -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) Permissions needed - Outputs: - Snapshot -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) Permissions needed - Outputs: - Snapshot = current user’s context -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) *Supported back to Froyo (2.2) Permissions needed - Outputs: Snapshot = current user’s context - Fence = register a listener (flag or combo) -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) Misc. -
Anticipate your users Available data points to consider Misc. device
listeners (screen, network, battery, dock) Awareness API (Activity, location, Beacons, Headphones) Misc. (time, calendar and schedule) -
Anticipate your users Available data points to consider • Connectivity
• Battery • Activity • Location • Time of day • Calendar • Weather • Ear phones yes/no -
Anticipate your users Connectivity On Wi-Fi: • Feel free to
fetch more often -
Anticipate your users Connectivity On Wi-Fi: Feel free to fetch
more often • Fetch data for later -
Anticipate your users Connectivity On Wi-Fi: Feel free to fetch
more often • Fetch data for later (*if you can cache it) -
Anticipate your users Connectivity On Wi-Fi: Feel free to fetch
more often • Fetch data for later (you MUST cache it) -
Anticipate your users Connectivity On Wi-Fi (feel free-er) On metered
networks (depends) -
Anticipate your users Battery Charged/charging (go nuts) <50% (be more
careful) <20% (mission critical only!) -
Anticipate your users Activity Walking/running/driving? • Sport results app: fetch
less • Navigation/music app: user notification -
Anticipate your users Activity On the go (depends) On the
couch? • Stationary • Location = home/office • Connectivity = Wi-Fi • No upcoming meetings? -
Anticipate your users Activity On the go (depends) On the
couch? • Stationary • Location = home/office • Connectivity = Wi-Fi • No upcoming meetings? = Go absolutely wild! -
Anticipate your user Battery is low: - Good ideas: -
Give the user a choice Consider the following -
Anticipate your user Battery is low: - Good ideas: Give
the user a choice - Decrease activity Consider the following -
Anticipate your user Battery is low: - Good ideas: Give
the user a choice - Decrease activity (unless you’re mission critical) Consider the following -
Anticipate your user You’re on Wi-Fi: - Bad idea =
update ALL!!! Consider the following -
Anticipate your user You’re on Wi-Fi: Bad idea = update
ALL!!! - Good idea = update more Consider the following -
Anticipate your user You’re on Wi-Fi: Bad idea = update
ALL!!! - Good idea = update more (ONLY what you’ll use) Consider the following -
Anticipate your user User running in the park w/ headphones
Consider the following -
Anticipate your user User running in the park w/ headphones:
- Good idea = start playing a playlist Consider the following -
Anticipate your user User running in the park w/ headphones:
Good idea = start playing a playlist - Bad idea = fetch data for a news app Consider the following -
Anticipate your user Running+park+headphones = playlist Running+alley-headphones - Bad idea
= start playing a playlist Consider the following -
Anticipate your user Running+park+headphones = playlist Running+alley-headphones: Bad idea =
start playing a playlist - Good idea = loud alarm Consider the following -
Anticipate your user Running+park+headphones = playlist Running+alley-headphones: Bad idea =
start playing a playlist - Good idea = loud alarm + speed dial police Consider the following