android performance

30
May the “Performance” be with you DAIICT - June 2016

Upload: prajyot-mainkar

Post on 16-Apr-2017

156 views

Category:

Technology


1 download

TRANSCRIPT

May the “Performance” be with youDAIICT - June 2016

source: app annie

Top Apps on Google Play, United States, Applications

source: android

Android Distribution (June 2016)

Power Consumption

Battery Life is very important to the consumersBattery Life

WiFi Speed/Quality

Touch Screen

Screen/Display Size

Display Type/ Quality

Connectivity

Memory

Display Resolution

0 10 20 30 40 50 60 70 80 90 100

38%

42%

44%

46%

46%

48%

52%

72%

Source: Qualcomm Band Tracker, Market Search Group, US

..but it is a Developer’s concern

Power is a part of User Experience

Power is important to the Mobile users

“Bad” ratings / Uninstall is the only escape

Compromising For Benefits

20-30% Core Functions

70% - Ads, GPS, Analytics

…You need to balance

20-30% Core Functions

70% - Ads, GPS, Analytics

Reducing Battery Drain

Just the right moment (no sleep?)

Uploading of Files/Songs

Cropping of Images

Unwanted loading

WakeloackAlarm managerJob scheduler

Thank you “network” request

if Polling for network requests

Response Packets

Device being awake

But you can check the stats

Wakelock Time

Network Time

Wakelock:

Wakelock..really?

Issue/Issues batch? Job Scheduler

Moment you first write your GPS Code

GPS: God of Battery DrainDo you really need GPS?

Approximation?

Ask UserCarry On

WTH?

YesNo

YesNo

Tips for Optimize network power Prefetch data

Batch transfer and connections

Detect network state

Avoid polling

Use caching

Varying download pattern

Monitor charge level and state

Monitor and determine docking state

Programmatic control over features

Use the DDMS Network Traffic Tool

Prefetch Data

A way to avoid number of independent data transfer sessions

Allows user to download all the data in a given period in a single burst & connection, at full capacity

Reduces radio activations and bandwidth, improves battery life and latency

e.g Music Player, News reader

Batch transfer and connectionsBundle your data transfers and create a pending transfer queue

Transfer as much data as possible during each transfer session to limit the number of sessions you require

Detect Network State

WiFi will be fast and Cheap - give priority

Are you on Roaming?

Avoid connections if NO Network is available.

Manipulate Broadcast receivers on demand

Using GCM instead of PollingNew News?

NoNew News?

NoNew News?

No

New News available

OK

Use Caching to avoid redundant download

Varying Download Pattern

Modify the pattern based on connection type

Download more data per session on faster networks

..but involve user in this scene

Force a quicker pre-fetch

Monitor charge level and stateMaximise app updates and its frequency when battery is chargingAvoid updates when charge state is discharging

Monitor and Determine Docking State

Dock-State is typically linked to the charging stage

Opt to update the frequency of update when charged with desktop dock than car dock

Dock Types

Car Desk Low-End (Analog) Desk

High-End (Digital) Desk

Programmatic Control over Features

Darker Color, Lesser Consumption

Brightness Level have more impact

An expensive component if used in an app

Avoid fine-point location, unless really necessary

Sync smartly

Tips for using App’s Data Using Services Sparingly ( use IntentService) Release memory when User switch apps( onTrimMemory() ) Release memory as memory becomes tight Avoid OutofMemory Avoid wasting memory with bitmaps Be aware of memory overhead Avoid dependency injection frameworks Be careful about using external libraries Optimize overall performance Use ProGuard to strip out any unneeded code Use ZipAlign ( avoids high RAM usage) Analyze your RAM usage Use Multiple Processes ( e.g music player)

@prajyotm

+prajyotmainkar

ThankYou!

ANDROCID MEDIA PVT. LTD.

PRAJYOT MAINKAR [email protected] +91 98229 87513

CONTACT DETAILS http://www.androcid.com