Top Banner
Building for theNext Billion Users Sidiq Permana Google Developer Expert and Intel Android Software Innovator TechMagician at Nusantara Beta Studio ID-Android Developer Tech Talk #4 Malang, April 2 2016
58

Sidiq Permana - Building For The Next Billion Users

Jan 11, 2017

Download

Technology

Dicoding
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sidiq Permana - Building For The Next Billion Users

Building for theNext Billion

Users

Sidiq Permana

Google Developer Expert and Intel Android Software Innovator

TechMagician at Nusantara Beta Studio

ID-Android Developer Tech Talk #4

Malang, April 2 2016

Page 2: Sidiq Permana - Building For The Next Billion Users

Why should we focus more

on next billion ?

Page 3: Sidiq Permana - Building For The Next Billion Users

1.4 Bilion+ Active Android Users

400 OEMs and 500 Carriers

Able to sell your app in 130 Countries

Disribute to 190+ Countries

65 Countries that you can tailor your app

pricing

Page 4: Sidiq Permana - Building For The Next Billion Users

Data source: GSMA https://gsmaintelligence.com/metrics/1/0/data/?report=535ac4dab8137

Internet penetration per country: ITU Measuring the Information Society http://www.itu.int/en/ITU-D/Statistics/Pages/publications/anapub.aspx

1 billion new users are expected to come online by 2017,

mostly from emerging market

Page 5: Sidiq Permana - Building For The Next Billion Users

D

World Bank country GDP classification: http://data.worldbank.org/about/country-and-lending-groups Human development index: http://hdr.undp.org/en/countries

Socio-economic statistics: www.gapminder.org

OECD countries: www.oecd.org

78% of the world’s population lives in emerging markets

(5.7 billion people)

Page 6: Sidiq Permana - Building For The Next Billion Users
Page 7: Sidiq Permana - Building For The Next Billion Users
Page 8: Sidiq Permana - Building For The Next Billion Users
Page 9: Sidiq Permana - Building For The Next Billion Users
Page 10: Sidiq Permana - Building For The Next Billion Users

It’s a Different Ballgame

● Slow and Expensive Internet

● Prepaid is used by >95% of users

● Mobile first

Page 11: Sidiq Permana - Building For The Next Billion Users

In short, we have to rethink

about the parameters we

consider when we are

building mobile apps

Page 12: Sidiq Permana - Building For The Next Billion Users

Top 11 Best Practices:Building for the next Billion Users*

* Also the last billion, and the billion after the next

Page 13: Sidiq Permana - Building For The Next Billion Users

#11Responsiveness

Page 14: Sidiq Permana - Building For The Next Billion Users

Touch Latency

“A time delay between the cause and the effect”

--Wikipedia

Page 15: Sidiq Permana - Building For The Next Billion Users

Reducing Perceived Latency

● Every UI action should have an immediate visible reaction

○ Hide/show views, scrolling views, state changes

● Every touchable item should have touch feedback

○ Use touch ripple from android 5.0+

Material: Responsive Design

goo.gl/zMDilf

Page 16: Sidiq Permana - Building For The Next Billion Users
Page 17: Sidiq Permana - Building For The Next Billion Users

#10Design

Page 18: Sidiq Permana - Building For The Next Billion Users

● Material design guidelines an extensive multi-year effort

● Make user intuitively know how to use your app

● Adaptive design methodology

Material Design Spec

google.com/design/spec

Page 19: Sidiq Permana - Building For The Next Billion Users
Page 20: Sidiq Permana - Building For The Next Billion Users

#9Anticipate

Page 21: Sidiq Permana - Building For The Next Billion Users

Prefetch Content

Anticipate what content your users may want

and have it ready

Take advantage of good device state, be

conservative instead

Page 22: Sidiq Permana - Building For The Next Billion Users

Prefetch Content

Use JobScheduler for Android 5.0+

There are alternatives for Android < 5.0:

● Android Job by Evernote

● GCM Network Manager

Using Job Scheduler

goo.gl/nK8X8g

Page 23: Sidiq Permana - Building For The Next Billion Users
Page 24: Sidiq Permana - Building For The Next Billion Users

#8Mobile Data isValuable

Page 25: Sidiq Permana - Building For The Next Billion Users

Be smart about mobile data usage

Mobile Data mostly hast monthly quota and

cost real money

Smartphones aren’t as smart without

mobile data

Page 26: Sidiq Permana - Building For The Next Billion Users

Be smart about mobile data usage

Mobile Data mostly hast monthly quota and

cost real money

Smartphones aren’t as smart without

mobile data

Managing Network Usage

goo.gl/AZA23R

Page 27: Sidiq Permana - Building For The Next Billion Users
Page 28: Sidiq Permana - Building For The Next Billion Users

#7WebP

Page 29: Sidiq Permana - Building For The Next Billion Users

What is WebP?

● Open Source

● Support lossy and lossless format

● Supported Natively on Android since 4.0 and with Lossless Format since

4.2; Supported in Chrome and Opera

● 24-34% better compression than JPEG; 28% better than PNG with little to

no loss in visible quality

Page 30: Sidiq Permana - Building For The Next Billion Users

Why WebP?

● Reduce network usage

● Reduce bundled image asset sizes in your app/game for faster installs and

updates

● Downside is encoding and hosting multiple formats

WebP for developers

goo.gl/laQtI4

Page 31: Sidiq Permana - Building For The Next Billion Users

#6Put your APK On a Diet

Page 32: Sidiq Permana - Building For The Next Billion Users
Page 33: Sidiq Permana - Building For The Next Billion Users

Put your APK on diet

APK size matters

Google Play smart app updates can help

Avoid users turning off auto-updates

Page 34: Sidiq Permana - Building For The Next Billion Users

Put your APK on diet

● Choose drawable assets carefully

○ Remember assets scaled down look OK but not the reverse

● Launcher icons include up to xxxhdpi

○ Store in mipmap- directories (eg. mipmap-hdpi)

● Remove unused code and resources

○ minifyEnabled=true

○ shrinkResources=true

● Multiple APK an option but has tradeoffs

Page 35: Sidiq Permana - Building For The Next Billion Users

#5Smooth like Butter

Page 36: Sidiq Permana - Building For The Next Billion Users

Keep graphics performance smooth

Aim for 60fps, this allows for ~16ms per frame

(1000/60)

Reduce “actual latency” - easier said than done

Page 37: Sidiq Permana - Building For The Next Billion Users

Keep graphics performance smooth

● Minimize layout overdraw and layout depth

● Only run UI updates and logic on the UI thread

● Memory allocations can cause GC

○ Images often to blame - use a library like Glide or Picasso

● Use on-device tools: GPU profiling and overdraw

Performance patterns video series

goo.gl/3dBbse

Page 38: Sidiq Permana - Building For The Next Billion Users
Page 39: Sidiq Permana - Building For The Next Billion Users

#4Battery

Page 40: Sidiq Permana - Building For The Next Billion Users

Primary consumer of battery:● Screen

● Mobile Network

● Inability to enter into low power mode

Page 41: Sidiq Permana - Building For The Next Billion Users

Reduce Battery Usage

● Avoid holdingWakeLocks directly

○ Use FLAG_KEEP_SCREEN_ON and WakefulBroadcastReceiver

● Use the new JobScheduler API in Android 5.0+

● Batch network transfers and connections

● User facing battery blaming and new developer tooling

Keeping the device awake

goo.gl/EQVB0i

Page 42: Sidiq Permana - Building For The Next Billion Users

Battery Historian

adb shell dumpsys batterystats

Page 43: Sidiq Permana - Building For The Next Billion Users

#3Memory

Page 44: Sidiq Permana - Building For The Next Billion Users

Reduce Memory Usage

Avoid long running services -

be a good citizen

More background memory

usage leads to slower

multitasking and less system

efficiency

Page 45: Sidiq Permana - Building For The Next Billion Users

Reduce Memory Usage

● Subclass IntentService not Service

● Let the system wake you

○ GCM, JobScheduler,AlarmManager or other system events

● ActivityManager.isLowRamDevice()

○ ~512MB with 800x480 or less screen

● Process stats and new memory monitor

Page 46: Sidiq Permana - Building For The Next Billion Users

Memory Monitor

Page 47: Sidiq Permana - Building For The Next Billion Users

#2Architecture

Page 48: Sidiq Permana - Building For The Next Billion Users

App Architecture

The right app architecture can dramatically improve the user

experience

Optimize for fast, responsive UI that is not tied to long running

operations like networkrequests

Google I/O 2014 App

github.com/google/iosched

Page 49: Sidiq Permana - Building For The Next Billion Users

App Architecture

● Ensure identical network requests are never duplicated

○ Use a local database for long lived data

○ Use a bounded disk cache for transitory data

● Screens should still be navigable even if network is down

● Never block the UI due to a long running operation

○ Use inline loading spinners if needed

○ Use AsyncTask but only for UI related background operations

Page 50: Sidiq Permana - Building For The Next Billion Users

#1Good app comes

from good codes

Page 51: Sidiq Permana - Building For The Next Billion Users

Three common problems

• It can be difficult to integrate new features as you are worried about compatibility

with the existing system.

• Time is spent fixing old code, which have developed mysterious bugs that are hard

to reproduce and to fix.

• You may have forgotten what a lot of the code does, and so you may be afraid that

touching it will break the system.

Page 52: Sidiq Permana - Building For The Next Billion Users

Good code is understandable

codeUnderstandable code is easier to maintain, easier for

new developers to learn, easier to debug, faster to find

what you're looking for, and most importantly: helps

that the programmers writing the code actually

understand business objectives.

Page 53: Sidiq Permana - Building For The Next Billion Users

Good codes aspects

• Syntax

•Architecture

•Workflow

Page 54: Sidiq Permana - Building For The Next Billion Users

Learn more

Start to write a

better code to

write a better

future!

Page 55: Sidiq Permana - Building For The Next Billion Users

Say Good Bye to a Spaghetti Code

Page 56: Sidiq Permana - Building For The Next Billion Users

#0Summary

Page 57: Sidiq Permana - Building For The Next Billion Users

Summary

11. Responsiveness 10. Material

Design

9. Anticipate

8. Smart Datausage 7. WebP 6. Put your APK ondiet

5. Smooth likebutter 4. Battery 3. Memory

2. AppArchitecture 1. Good Codes

Page 58: Sidiq Permana - Building For The Next Billion Users

Thanks