efficient data transfer in android

19
Efficient Data Transfer in Android Ralph Pina

Upload: cotap-engineering

Post on 15-Jul-2015

176 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Efficient data transfer in Android

Efficient Data Transfer in AndroidRalph Pina

Page 2: Efficient data transfer in Android

Topics- Radio state machine- Big vs small cookie model- Best practices- Analyze your data transfer- Resources for those interested

Page 3: Efficient data transfer in Android

Radio State MachineFull power: Used when a connection is active, allowing the device to transfer data at its highest possible rate.

Low power: An intermediate state that uses around 50% of the battery power at the full state.

Standby: The minimal energy state during which no network connection is active or required.

- AT&T timing for 3G

Page 4: Efficient data transfer in Android
Page 5: Efficient data transfer in Android
Page 6: Efficient data transfer in Android

And then… show the user

Page 7: Efficient data transfer in Android

Bundle Data Transfers

Page 8: Efficient data transfer in Android

More graphs!

Page 9: Efficient data transfer in Android

Wow power!

Page 10: Efficient data transfer in Android

Prefetch!“The single most important measure: transmit as much data as possible in a single burst and then end the connection.” - AT&T Labs

Page 11: Efficient data transfer in Android

Parallelize!- Parallelize requests

Page 12: Efficient data transfer in Android

Download Patterns!- Optimize download patterns based on data connection.

- Prefetch more in 4G since you have higher speed and it takes more power for the antenna to come back.

Page 13: Efficient data transfer in Android
Page 14: Efficient data transfer in Android

More stuff!- In Android, use SyncAdapter. Let the OS do the the sync!- Variable data transfers depending on usage.- Sync when device is connected to power.

Page 15: Efficient data transfer in Android

How GCM Works- Phone connected via TCP port 5228- Periodic heartbeat keeps the connection alive.15 min on Wifi and 28 min on cell

Page 16: Efficient data transfer in Android

Cotap Device Msging?- Build our own MQTT server - invented by IBM, very low power/bandwidth- Current examples: Eclipse PahoFacebook Messenger and main app

Page 17: Efficient data transfer in Android

Show and tell- AT&T ARO

- supports second rate OS like iOS and WP8!

- Android Monitor - <sdk location>/tools/monitor

Page 18: Efficient data transfer in Android

Resources/Citations- AT&T: A Call For More Energy Efficient Apps - http://www.research.att.com/articles/featured_stories/2011_03/201102_Energy_efficient?fbid=Fp7Al9yFu9_

- AT&T ARO: https://github.com/attdevsupport/ARO

- Android Root Push Notification Fixer: https://play.google.com/store/apps/details?id=com.andqlimax.pushfixer&hl=en

- MQTT in Android: http://mqtt.org/wiki/doku.php/mqtt_on_the_android_platform

- Facebook: Building Facebook Messanger - https://www.facebook.com/notes/facebook-engineering/building-facebook-messenger/10150259350998920

- DevBytes: Efficient Data Transfers - Understanding the Cell Radio (8/21/13): http://www.youtube.com/watch?v=cSIB2pDvH3E

- DevBytes: Efficient Data Transfers - Analyzing Your Transfer Profile (8/28/13): https://www.youtube.com/watch?v=cLqWYeQcG94

- DevBytes: Efficient Data Transfers - Effective Prefetching (9/4/13): http://www.youtube.com/watch?v=Rk1u7VVmadE

- Using connectivity patterns: http://developer.android.com/training/efficient-downloads/connectivity_patterns.html

- Using Sync Adapters: http://developer.android.com/training/sync-adapters/index.html

Page 19: Efficient data transfer in Android

Resources/Citations- DevBytes: Efficient Data Transfers - Batching, Bundling, and SyncAdapters (9/11/13): http://www.youtube.com/watch?v=5onKZcJyJwI

- DevBytes: Efficient Data Transfers - Eliminating Polling with Google Cloud Messaging (9/20/13): https://www.youtube.com/watch?v=cJbGK6cVmSM

- DevBytes: Efficient Data Transfers - Variable Update Frequencies (9/25/13): https://www.youtube.com/watch?v=9z1BfyqmsyA

- DevBytes: Efficient Data Transfers - Minimizing Payloads (10/2/13): http://www.youtube.com/watch?v=OfYLG6FXtqE

- AT&T Research - Tail Optimization Protocol: http://www.research.att.com/export/sites/att_labs/techdocs/TD_100036.pdf

- Google I/O 2014 App: https://github.com/google/iosched

- Analyzing ARO Data: https://developer.att.com/static-assets/documents/aro/ATT_ARO_Analysis_Guide_3-2.pdf

- LTE Long and Short DRX Cycles to Save Power: http://mobilesociety.typepad.com/mobile_life/2009/12/lte-long-and-short-drx-cycles-to-save-power.html