SlideShare a Scribd company logo
1 of 44
OptimizingYour Apps
For Emerging Markets
#DroidconMtl
Emerging Markets
Drive Growth
Source:Mediacellsvia TheGuardian
Source:Mediacellsvia TheGuardian
44
36
21
51
37
11
80
10
9
25
66
9
Smartphone Featurephone Multimediaphone
Brazil Russia
India China
1. Optimizing App Size
The smaller, the better
ColorFilters
Use Color Filter
• Faster way to experimentwithcolor schemes.
• Reduce thenumber of assets, which in turn reduces
theapk size.
• Less memory used as the number of assets are
reduced.
Code
ImageViewredCircle=(ImageView)findViewById(R.id.circle_red_imageview);
ImageViewgreenCircle=(ImageView)findViewById(R.id.circle_green_imageview);
ImageViewblueCircle=(ImageView)findViewById(R.id.circle_blue_imageview);
// wecancreatethecolor valuesindifferent ways:
redCircle.getDrawable().setColorFilter(Color.RED,PorterDuff.Mode.MULTIPLY);
greenCircle.getDrawable().setColorFilter(0xff00ff00,PorterDuff.Mode.MULTIPLY);
blueCircle.getDrawable().setColorFilter(getResources().getColor(R.color.blue),PorterDuff.Mode.
MULTIPLY);
Image
Optimizations
ColorFilters
JPEG WEBP PNG GIF
Lossy
Lossless
Transparency
Animation
WebP
No Noticeable Change
PNG
24kb
WebP
10kb
Compatibility
• You can use thenativeWebP decoder on 4.2 and
later.
• For lower versions, use libpng to convert to PNG
format and thenuseit intheapp.
Other Libraries
• Use programs like OptiPNG,TruePNG and PNGCrush
to significantlyreduce the size of PNG images.
• Use mozjpeg for jpegimages.
• 5-10% size reduction
• Won’t cause any visible changesto the images.
Remove Unused
Content
Image
Optimizations
ColorFilters
Remove Unused Content
• Use Resource Shrinking.
Code
android{
...
buildTypes{
release{
minifyEnabledtrue
shrinkResourcestrue
proguardFilesgetDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
Remove Unused Content
• Use Resource Shrinking.
• Use tools likeLintand ProGuard.
• Use Android-Unused-Resources jar fileif you are
stillusingEclipse.
https://code.google.com/p/android-unused-resources/
2.Optimizing Network
Calls
Expensive DataFlaky Networks
Challenges
Build for Failure
Most efficient way to
transfer is to not transfer
Image Scaling
Appropriate Image Size
• Store multipleimagesizes on the server
• Low-res devices mightnever need a fullresolution
image
• Most timesthe smallest imagesize is sufficient.
ChecksumImage Scaling
Client A Client BServer
Checksum
ID
Send File ID
TransferFile
CS ID
Code
publicstaticStringgetMD5EncryptedString(StringencTarget){
MessageDigest mdEnc=null;
mdEnc=MessageDigest.getInstance("MD5");
// Encryptionalgorithm
mdEnc.update(encTarget.getBytes(),0,encTarget.length());
Stringmd5=newBigInteger(1,mdEnc.digest()).toString(16);
while(md5.length()<32){
md5="0"+md5;
}
returnmd5;
}
Checksum
• Avoid transfers as muchas possible.
• For filetransfers, first compute themd5 checksum
and send it to the server to checkif it already exists
on theserver.
• The cost to upload theentire file againcan be
avoided.
Image Scaling Checksum Transferin Blocks
Transfer in blocks
• Do data transfers in blocks.
• Keeptrack of the blocks thathave been transferred
and yet to be transferred.
• The block size can vary based on the type of
connection.
Testing for different
networks is a pain
Testing for different networks
• Facebook recently open-sourced AugmentedTraffic
Control(ATC).
• It is a tool to simulatenetworkconditions.
• It can simulate2G, Edge, 3G, and LTE networks.
• Has multipleprofiles for a lot of differentcountries.
http://facebook.github.io/augmented-traffic-control/
3.Optimizing for Different
Phones
Small ScreensSlow Processing
Challenges
Developing for flagship
devices is easy
YearClass
Code
int year =YearClass.get(getApplicationContext());
if (year >=2013){
// Doadvancedanimation
}elseif (year >2010){
// Dosimpleanimation
}else{
// Phonetooslow,don't doanyanimations
}
https://github.com/facebook/device-year-class
RedesignYearClass
Redesign
• Remove featuresfrom low-end devices if they won’t
have the best user experience.
• This could be animations,videos or even
functionalities.
• No feature>>>Bad feature
@vinaygaba
Questions?

More Related Content

Similar to Emerging Markets Drive Growth Through Mobile App Optimization

MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014Dylan Tong
 
Engineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or InnovateEngineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or InnovateSteve Andrews
 
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...Databricks
 
Getting Ready to Use Redis with Apache Spark with Dvir Volk
Getting Ready to Use Redis with Apache Spark with Dvir VolkGetting Ready to Use Redis with Apache Spark with Dvir Volk
Getting Ready to Use Redis with Apache Spark with Dvir VolkSpark Summit
 
MongoDB Days UK: Securing Your Deployment with MongoDB Enterprise
MongoDB Days UK: Securing Your Deployment with MongoDB EnterpriseMongoDB Days UK: Securing Your Deployment with MongoDB Enterprise
MongoDB Days UK: Securing Your Deployment with MongoDB EnterpriseMongoDB
 
Securing Your Deployment with MongoDB Enterprise
Securing Your Deployment with MongoDB EnterpriseSecuring Your Deployment with MongoDB Enterprise
Securing Your Deployment with MongoDB EnterpriseMongoDB
 
Learning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and KaggleLearning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and KaggleYvonne K. Matos
 
DevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityDevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityCoverity
 
Android is not just mobile
Android is not just mobileAndroid is not just mobile
Android is not just mobileKevin McDonagh
 
Redis Streams plus Spark Structured Streaming
Redis Streams plus Spark Structured StreamingRedis Streams plus Spark Structured Streaming
Redis Streams plus Spark Structured StreamingDave Nielsen
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
PredictionIO - Scalable Machine Learning Architecture
PredictionIO - Scalable Machine Learning ArchitecturePredictionIO - Scalable Machine Learning Architecture
PredictionIO - Scalable Machine Learning Architecturepredictionio
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Matteo Valoriani
 
Develop Store Apps with Kinect for Windows v2
Develop Store Apps with Kinect for Windows v2Develop Store Apps with Kinect for Windows v2
Develop Store Apps with Kinect for Windows v2Clemente Giorio
 
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data WarehouseReal-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data WarehousePrecisely
 
Mining software vulns in SCCM / NIST's NVD
Mining software vulns in SCCM / NIST's NVDMining software vulns in SCCM / NIST's NVD
Mining software vulns in SCCM / NIST's NVDLoren Gordon
 
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...Provectus
 

Similar to Emerging Markets Drive Growth Through Mobile App Optimization (20)

MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014
 
Engineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or InnovateEngineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or Innovate
 
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
 
Accelerating DynamoDB with DAX
Accelerating DynamoDB with DAX Accelerating DynamoDB with DAX
Accelerating DynamoDB with DAX
 
Getting Ready to Use Redis with Apache Spark with Dvir Volk
Getting Ready to Use Redis with Apache Spark with Dvir VolkGetting Ready to Use Redis with Apache Spark with Dvir Volk
Getting Ready to Use Redis with Apache Spark with Dvir Volk
 
MongoDB Days UK: Securing Your Deployment with MongoDB Enterprise
MongoDB Days UK: Securing Your Deployment with MongoDB EnterpriseMongoDB Days UK: Securing Your Deployment with MongoDB Enterprise
MongoDB Days UK: Securing Your Deployment with MongoDB Enterprise
 
Securing Your Deployment with MongoDB Enterprise
Securing Your Deployment with MongoDB EnterpriseSecuring Your Deployment with MongoDB Enterprise
Securing Your Deployment with MongoDB Enterprise
 
Learning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and KaggleLearning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and Kaggle
 
DevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityDevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first Security
 
Android is not just mobile
Android is not just mobileAndroid is not just mobile
Android is not just mobile
 
Redis Streams plus Spark Structured Streaming
Redis Streams plus Spark Structured StreamingRedis Streams plus Spark Structured Streaming
Redis Streams plus Spark Structured Streaming
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
PredictionIO - Scalable Machine Learning Architecture
PredictionIO - Scalable Machine Learning ArchitecturePredictionIO - Scalable Machine Learning Architecture
PredictionIO - Scalable Machine Learning Architecture
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2
 
Develop Store Apps with Kinect for Windows v2
Develop Store Apps with Kinect for Windows v2Develop Store Apps with Kinect for Windows v2
Develop Store Apps with Kinect for Windows v2
 
Introduction to threat_modeling
Introduction to threat_modelingIntroduction to threat_modeling
Introduction to threat_modeling
 
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data WarehouseReal-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
 
Mining software vulns in SCCM / NIST's NVD
Mining software vulns in SCCM / NIST's NVDMining software vulns in SCCM / NIST's NVD
Mining software vulns in SCCM / NIST's NVD
 
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...
Data Summer Conf 2018, “How we build Computer vision as a service (ENG)” — Ro...
 

Emerging Markets Drive Growth Through Mobile App Optimization