SlideShare a Scribd company logo
1 of 25
Download to read offline
Little
Networks
Stacy Devino
Dallas Android Developers
Jan. 2016
STACY DEVINO
•Senior Android Innovator at The Home
Depot Dallas Technology Center
•Works on Consumer Mobile App and
Internal Product Innovation
•WTM Lead DFW, SixSigma BlackBelt,
Intel Innovator, DMS Member, Vintage
game collector/restorer
2
WEBSITES
www.stacydevino.com
www.ledgoes.com
www.openbrite.com
EMAIL
childofthehorn@gmail.com
G+
https://plus.google.com/
+StacyDevino
TWITTER
@DoesitPew
Biggest Issues
● Large, Unfiltered Images
● Untracked Data Usage (Does that API really
need to be active right now? )
● Non-optimized Network handling (Batching)
● Not Using the Android tools to help you
● Bad API designs
● Doubled / Badly Handled API calls
3
Tracking Your Application Data
Using the Android Tools
Network Monitor in Android Studio
TrafficStats API in Android (http://goo.gl/9cu59J)
Watching your APIs and responses
Charles Proxy (not free, but worth the money)
Detailed Tracking of Network Data (with Forensics)
Application Resource Optimizer (ARO) by ATT (easiest)
Wireshark
Shark for Root (locally on the device)
4
Capturing a PCAP
PCAP files are used to track network communications and data
Rooted Phones (see http://goo.gl/uMFv2N for non-rooted phones)
1. Grab a copy of tcpdump from http://goo.gl/YbyaA2
2. Go to Settings > Apps > Running Apps and Force Stop any services that are not part of the Android
System (or use Development options > Background process limit > At most 2 processes )
3. Now open just the app you want to test
4. Open a Terminal and type “adb push tcpdump /sdcard”, "adb shell", "su", “cp /sdcard/tcpdump /
system/xbin”, and then “chmod 755 tcpdump”
If using Wifi:
1. "tcpdump -i wlan0 -s 65535 -w /sdcard/networktrace.pcap"
If using Cellular (rmnetusb0 is also possible, look at “ip addr”):
1. "tcpdump -i rmnet0 -s 65535 -w /sdcard/networktrace.pcap"
5
Download + InstalL ARO
1.Download the appropriate version for your OS and
Mobile Platform here : https://goo.gl/gTIvwt
2.Download the DiffTool utility for doing side by side
comparisons of before and after a change https://
goo.gl/f1ai6M
3.Source for ARO : https://github.com/
attdevsupport/ARO
4.Install Dependencies : WinPCAP and JRE 6.0+
6
ARO Main Summary
▪ Quick, Valuable
insight to major
issues which may be
occurring.
▪ Track Image sizes and
downloaded
resources
▪ Cached Resources
▪ Duplicated APIs
▪ Areas of Improvement
7
ARO Main Summary (Competitor)
You can track your
app’s performance
just as well as you can
track your competitor.
It can be a great way
to see how your app
performance in that
market compares as
well as be able to find
valuable insight to
things they may be
doing right where you
are not.
8
ARO Main Summary (Competitor)
▪ Gives you the reasons
for your failures
▪ No cache headers?
▪ That could be a problem
for reused web
resources, making the
device re-download
(using more data).
▪ Cache is King! $$$$$
9
ARO Main Summary (Competitor)
10
ARO Profiles
▪ Define your own WIN
parameters
▪ Allows you to track your
performance against your
user defined values.
▪ Very useful if you have
made new Cellular
performance characteristics
to your APIs and need to
verify it is within the desired
performance (and getting
correct values!)
11
ARO Overview
12
ARO Diagnostics ( i.e.Network Monitor )
13
ARO Stats
Overall Score Sheet
How did Yah do?
Eh, not bad
But, we can DO BETTER!
14
▪ Compression is your FRIEND
▪ PNG vs JPEG vs WebP
▪ 85% Quality JPEG with Smoothing can reduce a 42MB PNG image to 185kb in the Real
World with virtually no loss in Visible Quality
▪ JPEG does not support Transparency
▪ Lossy Compression for Network pulled resources is the way to go for everything that is not
a Photo app (Ok, even a Photo Gallery... maybe not an editor)
▪ Saves MEMORY so you don’t get the dreaded OOME (OutofMemoryError)
▪ WebP is a Combo of the best of JPEG and PNG since it supports Transparency and High
Compression, but does not work for iPhones or universal Mobile Web (so, not a great
possibility for converged APIs)
▪ You can compress PNG lossy and losslessly, but it never quite gets to JPEG
15
Filtering your Images
16
ARGB_8888 ARGB_4444 RGB_565
Transparency X X
Number of Bits 32 16 16
Full Color
(nice
Gradients)
X X
Space on
Image Memory
Load (def.)
SAME SAME SAME
● ARGB_4444 and RGB_565 will be about the same in size (Data in Transit)
● ARGB_4444 is ideal for web icon assets with minimal color gradients and
needing Transparency
● No need of Transparency? RGB_565 is always ideal.
● Android will always load images into the same amount of memory,
regardless of compression, so use the Bitmap Options tools to save
Memory too
Types of Images
JPEG (or WebP) whenever possible (no Transparency needed)
ARGB_4444 for Iconography assets pulled from the network
Compress all your images (once)
Compress all your images (twice)
Compress all your images (three times a …) even PNGcrush!
Don’t be afraid to compress Lossy (especially with large images like
5MP+ Camera captured images, Google Photos does it!)
Compression on the Network != Compression in your Heap (do both)
Design your APIs to work with Screens of Many sizes
17
TL:DR Image Filtering
▪ ADJUST YOUR ASSETS BASED ON YOUR NETWORK TYPE!!!!!
▪ Very Simple, just use the BroadcastReceiver class I have
posted here: https://goo.gl/A5P1U3
▪ AND Facebook has an awesome DYNAMIC downstream
bandwidth connection class library that you can use here :
https://goo.gl/I7YLOE which can also be combined with their
YEARCLASS library here: https://goo.gl/Ztgxik
▪ That way you can dynamically adjust your API requests
for quality because SPEED MATTERS.
18
Tracking Your Network Type
Example Code
(Combine and expand)
https://github.com/childofthehorn/
network_classification_android
● Allows you to account for
Multiple Screen sizes without
skewing
● Dynamic Quality adjustment
based on networks (Bigger
screens can go down)
● Never get larger images than
what you need
● Build based off of the devices
you want to support.
● iPhones can also be
accounted for in the Android
sizing
20
Structuring Images for Speed
21
Ratio : 0.56:1 (16:9)
Devices : iPhone 5/6/6+,
Samsung 3/4/5/6
(Android Devices with
Hardware buttons)
HIGH
Width : 1440
Height : 2560
MEDIUM
Width : 1080
Height : 1920
LOW
Width : 720
Height : 1280
Ratio : 0.63:1
Devices : iPhone 4,
OnePlus 1/2, Nexus 5/5x/
6/6p/7(2013)/7(2014),
Moto X, G, E (2013-2015)
(Android devices with
software buttons)
HIGH
Width : 1440
Height : 2268
MEDIUM
Width : 1080
Height : 1701
LOW
Width : 720
Height : 1134
Ratio : 0.81:1
Devices : Nexus 9,
Samsung Tab S2, ZTE,
Alcatel OneTouch phones
(Prepaid smartphones
less than $100)),
HIGH
Width : 1536
Height : 1904
MEDIUM
Width : 1050
Height : 1400
LOW
Width : 640
Height : 800
Qualities BY network type
Serialized data types
JSON
• Most popular, most APIs are formatted like this
• Easy to use libraries like RetroFit and Android Volley
• Still somewhat human-readable
XML
• Very Human-readable and alterable
• LOTS of type-casting overhead, LEAST EFFICIENT
PROTOBUFFERS
• Natively Supported on Android, but totally platform neutral (use with any Language or Platform,
even iOS, Web, and Socket connections)
• Most efficient, but still popular way
• OMG Retrofit works here too now, so try for a combo when you can
• Must have formatted data that meets the expected format almost exactly, not a lot of error
handling here, but Square has provided a tool for easy Conversion and generating code : https://
github.com/square/wire
22
Batching your Data is one of the easiest ways to optimize your usage
of Cellular data.
Bundle Yourself
• Wait to offload large datasets ’til the user is on Wifi and hopefully
charging as well (metrics and user behavior)
• JSON is not very efficient (XML is way worse), see if it is possible to
switch to buffered data or binary files. Even CSV is more efficient...I
know, right?
• Bundle your requests and waits together (promotional notifications and
asset updates) this will give your user up to date data before they even
launch the app without using more battery or network data!
Bundle Together
▪ GCMNetworkManager makes it easy to do this
(https://goo.gl/ThFuyo)
23
Data Batching
1. Use lower quality images in low quality networks
2. Time to User matters (you only have a few hundred milliseconds)
3. Allow users to dictate resources and run in a low-usage network mode
(best performance vs. best quality)
4. You can handle virtually all resources with just 3 aspect ratios for all of
Android and iOS, as well as mobile web (Spiffy!)
5. Change your API requests to ProtoBuffers (Best) and JSON if possible
6. Batching your individual application data together and offload to high
speed networks when possible
7. Bundle as a system with GcmNetworkManager
24
TL:DR API Structure
THANKS
▪ The Home Depot DTC
▪ Google Developers
▪ Dallas Android Developers
▪ Android Performance Patterns
▪ ATT
▪ WireShark
▪ Big Android BBQ Team / IDEAA
25

More Related Content

What's hot

Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Nicholas Jansma
 
Going Fast on the Mobile Web
Going Fast on the Mobile WebGoing Fast on the Mobile Web
Going Fast on the Mobile WebJason Grigsby
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Matthew McCullough
 
Web Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionWeb Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionDave Olsen
 
How To Build a Multi-Field Search Page For Your XPages Application
How To Build a Multi-Field Search Page For Your XPages ApplicationHow To Build a Multi-Field Search Page For Your XPages Application
How To Build a Multi-Field Search Page For Your XPages ApplicationMichael McGarel
 
The Physical World meets the Web
The Physical World meets the WebThe Physical World meets the Web
The Physical World meets the WebMaximiliano Firtman
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Matt Raible
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...Yottaa
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Webphilogb
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsMike Brittain
 

What's hot (13)

Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
 
Going Fast on the Mobile Web
Going Fast on the Mobile WebGoing Fast on the Mobile Web
Going Fast on the Mobile Web
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Web Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionWeb Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas Version
 
How To Build a Multi-Field Search Page For Your XPages Application
How To Build a Multi-Field Search Page For Your XPages ApplicationHow To Build a Multi-Field Search Page For Your XPages Application
How To Build a Multi-Field Search Page For Your XPages Application
 
The Physical World meets the Web
The Physical World meets the WebThe Physical World meets the Web
The Physical World meets the Web
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
TxJS 2011
TxJS 2011TxJS 2011
TxJS 2011
 
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty Details
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 

Similar to Big Trouble in Little Networks, new and improved

Big Trouble in Little Networks
Big Trouble in Little Networks Big Trouble in Little Networks
Big Trouble in Little Networks Stacy Devino
 
Sidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion UsersSidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion UsersDicoding
 
Batty consumerization of geospatial
Batty consumerization of geospatialBatty consumerization of geospatial
Batty consumerization of geospatialGeCo in the Rockies
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Phonegap - An Introduction
Phonegap - An IntroductionPhonegap - An Introduction
Phonegap - An IntroductionTyler Johnston
 
Are you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsAre you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsJamie Indigo
 
Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Rachel Anderson
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
summer file - Copy
summer file - Copysummer file - Copy
summer file - CopyRakesh Kumar
 
Lambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataLambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataTrieu Nguyen
 
Google Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG BelgaumGoogle Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG Belgaumsandeephegde
 
Top 13 web scraping tools in 2022
Top 13 web scraping tools in 2022Top 13 web scraping tools in 2022
Top 13 web scraping tools in 2022Aparna Sharma
 
Improve your Tech Quotient
Improve your Tech QuotientImprove your Tech Quotient
Improve your Tech QuotientTarence DSouza
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloudwesley chun
 
Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Ido Green
 
What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015Christian Heilmann
 
Performance as UX with Justin Howlett
Performance as UX with Justin HowlettPerformance as UX with Justin Howlett
Performance as UX with Justin HowlettFITC
 
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...Google Cloud Platform - Japan
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional PerformanceNicole Sullivan
 
Making operations visible - Nick Gallbreath
Making operations visible - Nick GallbreathMaking operations visible - Nick Gallbreath
Making operations visible - Nick GallbreathDevopsdays
 

Similar to Big Trouble in Little Networks, new and improved (20)

Big Trouble in Little Networks
Big Trouble in Little Networks Big Trouble in Little Networks
Big Trouble in Little Networks
 
Sidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion UsersSidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion Users
 
Batty consumerization of geospatial
Batty consumerization of geospatialBatty consumerization of geospatial
Batty consumerization of geospatial
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Phonegap - An Introduction
Phonegap - An IntroductionPhonegap - An Introduction
Phonegap - An Introduction
 
Are you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsAre you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevTools
 
Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
summer file - Copy
summer file - Copysummer file - Copy
summer file - Copy
 
Lambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataLambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big data
 
Google Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG BelgaumGoogle Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG Belgaum
 
Top 13 web scraping tools in 2022
Top 13 web scraping tools in 2022Top 13 web scraping tools in 2022
Top 13 web scraping tools in 2022
 
Improve your Tech Quotient
Improve your Tech QuotientImprove your Tech Quotient
Improve your Tech Quotient
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloud
 
Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Google Platform Overview (April 2014)
Google Platform Overview (April 2014)
 
What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015
 
Performance as UX with Justin Howlett
Performance as UX with Justin HowlettPerformance as UX with Justin Howlett
Performance as UX with Justin Howlett
 
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...
Google Developers Summit Tokyo - Google Cloud Platform で知る Google クラウドの「Googl...
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
 
Making operations visible - Nick Gallbreath
Making operations visible - Nick GallbreathMaking operations visible - Nick Gallbreath
Making operations visible - Nick Gallbreath
 

More from Stacy Devino

IoT with Firebase : IoT DevFest Phoenix 2018
IoT with Firebase : IoT DevFest Phoenix 2018IoT with Firebase : IoT DevFest Phoenix 2018
IoT with Firebase : IoT DevFest Phoenix 2018Stacy Devino
 
Beautiful text spread your wings with Spannables
Beautiful text   spread your wings with SpannablesBeautiful text   spread your wings with Spannables
Beautiful text spread your wings with SpannablesStacy Devino
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Stacy Devino
 
Intro to Android : Making your first App!
Intro to Android : Making your first App!Intro to Android : Making your first App!
Intro to Android : Making your first App!Stacy Devino
 
RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16Stacy Devino
 
WWC 3D printing basics with stacy devino
WWC 3D printing basics with stacy devinoWWC 3D printing basics with stacy devino
WWC 3D printing basics with stacy devinoStacy Devino
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerStacy Devino
 

More from Stacy Devino (7)

IoT with Firebase : IoT DevFest Phoenix 2018
IoT with Firebase : IoT DevFest Phoenix 2018IoT with Firebase : IoT DevFest Phoenix 2018
IoT with Firebase : IoT DevFest Phoenix 2018
 
Beautiful text spread your wings with Spannables
Beautiful text   spread your wings with SpannablesBeautiful text   spread your wings with Spannables
Beautiful text spread your wings with Spannables
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!
 
Intro to Android : Making your first App!
Intro to Android : Making your first App!Intro to Android : Making your first App!
Intro to Android : Making your first App!
 
RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16
 
WWC 3D printing basics with stacy devino
WWC 3D printing basics with stacy devinoWWC 3D printing basics with stacy devino
WWC 3D printing basics with stacy devino
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical Hacker
 

Recently uploaded

Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfthietkevietthinh
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptjigup7320
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxhublikarsn
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Payal Garg #K09
 

Recently uploaded (20)

Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
 

Big Trouble in Little Networks, new and improved

  • 2. STACY DEVINO •Senior Android Innovator at The Home Depot Dallas Technology Center •Works on Consumer Mobile App and Internal Product Innovation •WTM Lead DFW, SixSigma BlackBelt, Intel Innovator, DMS Member, Vintage game collector/restorer 2 WEBSITES www.stacydevino.com www.ledgoes.com www.openbrite.com EMAIL childofthehorn@gmail.com G+ https://plus.google.com/ +StacyDevino TWITTER @DoesitPew
  • 3. Biggest Issues ● Large, Unfiltered Images ● Untracked Data Usage (Does that API really need to be active right now? ) ● Non-optimized Network handling (Batching) ● Not Using the Android tools to help you ● Bad API designs ● Doubled / Badly Handled API calls 3
  • 4. Tracking Your Application Data Using the Android Tools Network Monitor in Android Studio TrafficStats API in Android (http://goo.gl/9cu59J) Watching your APIs and responses Charles Proxy (not free, but worth the money) Detailed Tracking of Network Data (with Forensics) Application Resource Optimizer (ARO) by ATT (easiest) Wireshark Shark for Root (locally on the device) 4
  • 5. Capturing a PCAP PCAP files are used to track network communications and data Rooted Phones (see http://goo.gl/uMFv2N for non-rooted phones) 1. Grab a copy of tcpdump from http://goo.gl/YbyaA2 2. Go to Settings > Apps > Running Apps and Force Stop any services that are not part of the Android System (or use Development options > Background process limit > At most 2 processes ) 3. Now open just the app you want to test 4. Open a Terminal and type “adb push tcpdump /sdcard”, "adb shell", "su", “cp /sdcard/tcpdump / system/xbin”, and then “chmod 755 tcpdump” If using Wifi: 1. "tcpdump -i wlan0 -s 65535 -w /sdcard/networktrace.pcap" If using Cellular (rmnetusb0 is also possible, look at “ip addr”): 1. "tcpdump -i rmnet0 -s 65535 -w /sdcard/networktrace.pcap" 5
  • 6. Download + InstalL ARO 1.Download the appropriate version for your OS and Mobile Platform here : https://goo.gl/gTIvwt 2.Download the DiffTool utility for doing side by side comparisons of before and after a change https:// goo.gl/f1ai6M 3.Source for ARO : https://github.com/ attdevsupport/ARO 4.Install Dependencies : WinPCAP and JRE 6.0+ 6
  • 7. ARO Main Summary ▪ Quick, Valuable insight to major issues which may be occurring. ▪ Track Image sizes and downloaded resources ▪ Cached Resources ▪ Duplicated APIs ▪ Areas of Improvement 7
  • 8. ARO Main Summary (Competitor) You can track your app’s performance just as well as you can track your competitor. It can be a great way to see how your app performance in that market compares as well as be able to find valuable insight to things they may be doing right where you are not. 8
  • 9. ARO Main Summary (Competitor) ▪ Gives you the reasons for your failures ▪ No cache headers? ▪ That could be a problem for reused web resources, making the device re-download (using more data). ▪ Cache is King! $$$$$ 9
  • 10. ARO Main Summary (Competitor) 10
  • 11. ARO Profiles ▪ Define your own WIN parameters ▪ Allows you to track your performance against your user defined values. ▪ Very useful if you have made new Cellular performance characteristics to your APIs and need to verify it is within the desired performance (and getting correct values!) 11
  • 13. ARO Diagnostics ( i.e.Network Monitor ) 13
  • 14. ARO Stats Overall Score Sheet How did Yah do? Eh, not bad But, we can DO BETTER! 14
  • 15. ▪ Compression is your FRIEND ▪ PNG vs JPEG vs WebP ▪ 85% Quality JPEG with Smoothing can reduce a 42MB PNG image to 185kb in the Real World with virtually no loss in Visible Quality ▪ JPEG does not support Transparency ▪ Lossy Compression for Network pulled resources is the way to go for everything that is not a Photo app (Ok, even a Photo Gallery... maybe not an editor) ▪ Saves MEMORY so you don’t get the dreaded OOME (OutofMemoryError) ▪ WebP is a Combo of the best of JPEG and PNG since it supports Transparency and High Compression, but does not work for iPhones or universal Mobile Web (so, not a great possibility for converged APIs) ▪ You can compress PNG lossy and losslessly, but it never quite gets to JPEG 15 Filtering your Images
  • 16. 16 ARGB_8888 ARGB_4444 RGB_565 Transparency X X Number of Bits 32 16 16 Full Color (nice Gradients) X X Space on Image Memory Load (def.) SAME SAME SAME ● ARGB_4444 and RGB_565 will be about the same in size (Data in Transit) ● ARGB_4444 is ideal for web icon assets with minimal color gradients and needing Transparency ● No need of Transparency? RGB_565 is always ideal. ● Android will always load images into the same amount of memory, regardless of compression, so use the Bitmap Options tools to save Memory too Types of Images
  • 17. JPEG (or WebP) whenever possible (no Transparency needed) ARGB_4444 for Iconography assets pulled from the network Compress all your images (once) Compress all your images (twice) Compress all your images (three times a …) even PNGcrush! Don’t be afraid to compress Lossy (especially with large images like 5MP+ Camera captured images, Google Photos does it!) Compression on the Network != Compression in your Heap (do both) Design your APIs to work with Screens of Many sizes 17 TL:DR Image Filtering
  • 18. ▪ ADJUST YOUR ASSETS BASED ON YOUR NETWORK TYPE!!!!! ▪ Very Simple, just use the BroadcastReceiver class I have posted here: https://goo.gl/A5P1U3 ▪ AND Facebook has an awesome DYNAMIC downstream bandwidth connection class library that you can use here : https://goo.gl/I7YLOE which can also be combined with their YEARCLASS library here: https://goo.gl/Ztgxik ▪ That way you can dynamically adjust your API requests for quality because SPEED MATTERS. 18 Tracking Your Network Type
  • 19. Example Code (Combine and expand) https://github.com/childofthehorn/ network_classification_android
  • 20. ● Allows you to account for Multiple Screen sizes without skewing ● Dynamic Quality adjustment based on networks (Bigger screens can go down) ● Never get larger images than what you need ● Build based off of the devices you want to support. ● iPhones can also be accounted for in the Android sizing 20 Structuring Images for Speed
  • 21. 21 Ratio : 0.56:1 (16:9) Devices : iPhone 5/6/6+, Samsung 3/4/5/6 (Android Devices with Hardware buttons) HIGH Width : 1440 Height : 2560 MEDIUM Width : 1080 Height : 1920 LOW Width : 720 Height : 1280 Ratio : 0.63:1 Devices : iPhone 4, OnePlus 1/2, Nexus 5/5x/ 6/6p/7(2013)/7(2014), Moto X, G, E (2013-2015) (Android devices with software buttons) HIGH Width : 1440 Height : 2268 MEDIUM Width : 1080 Height : 1701 LOW Width : 720 Height : 1134 Ratio : 0.81:1 Devices : Nexus 9, Samsung Tab S2, ZTE, Alcatel OneTouch phones (Prepaid smartphones less than $100)), HIGH Width : 1536 Height : 1904 MEDIUM Width : 1050 Height : 1400 LOW Width : 640 Height : 800 Qualities BY network type
  • 22. Serialized data types JSON • Most popular, most APIs are formatted like this • Easy to use libraries like RetroFit and Android Volley • Still somewhat human-readable XML • Very Human-readable and alterable • LOTS of type-casting overhead, LEAST EFFICIENT PROTOBUFFERS • Natively Supported on Android, but totally platform neutral (use with any Language or Platform, even iOS, Web, and Socket connections) • Most efficient, but still popular way • OMG Retrofit works here too now, so try for a combo when you can • Must have formatted data that meets the expected format almost exactly, not a lot of error handling here, but Square has provided a tool for easy Conversion and generating code : https:// github.com/square/wire 22
  • 23. Batching your Data is one of the easiest ways to optimize your usage of Cellular data. Bundle Yourself • Wait to offload large datasets ’til the user is on Wifi and hopefully charging as well (metrics and user behavior) • JSON is not very efficient (XML is way worse), see if it is possible to switch to buffered data or binary files. Even CSV is more efficient...I know, right? • Bundle your requests and waits together (promotional notifications and asset updates) this will give your user up to date data before they even launch the app without using more battery or network data! Bundle Together ▪ GCMNetworkManager makes it easy to do this (https://goo.gl/ThFuyo) 23 Data Batching
  • 24. 1. Use lower quality images in low quality networks 2. Time to User matters (you only have a few hundred milliseconds) 3. Allow users to dictate resources and run in a low-usage network mode (best performance vs. best quality) 4. You can handle virtually all resources with just 3 aspect ratios for all of Android and iOS, as well as mobile web (Spiffy!) 5. Change your API requests to ProtoBuffers (Best) and JSON if possible 6. Batching your individual application data together and offload to high speed networks when possible 7. Bundle as a system with GcmNetworkManager 24 TL:DR API Structure
  • 25. THANKS ▪ The Home Depot DTC ▪ Google Developers ▪ Dallas Android Developers ▪ Android Performance Patterns ▪ ATT ▪ WireShark ▪ Big Android BBQ Team / IDEAA 25