Top Banner
From good to awesome
58

Making awesome apps

Jan 27, 2015

Download

Technology

DroidConTLV

Collection of tips & tricks that makes the difference between a good app and a "wow-affect" app. Relevant to product managers and developers (including some code samples)

As presented in DroidCon Tel Aviv 2014 by:
Ran Nachmany, MobiliUp
http://il.droidcon.com
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: Making awesome apps

From good to awesome

Page 2: Making awesome apps
Page 3: Making awesome apps
Page 4: Making awesome apps

Always up to date

Users don't like to wait. Location updated.

Data downloaded from web.

Page 5: Making awesome apps

Always up to date

Users don't like to wait. Location updated.

Data downloaded from web.

Page 6: Making awesome apps

Find the location fast.

Loop through all providers->getLastKnownLoc.If there is one or more location which is recent enough – return the most accurate one

If not – Return the latest one.

In case of #2 – look for “fastest” provider:Coarse Accuracy && low power consumption.

Register for location update.

Page 7: Making awesome apps

Fused Location

Define your priorities

Let Google play services do the heavy lifting.

Page 8: Making awesome apps

Using fused location

Page 9: Making awesome apps

Data updates

Page 10: Making awesome apps

The challenges:

When to update?

Where the data is coming from?

What to update?

How to update?

Page 11: Making awesome apps

When to update my App?

Right before the user launches itAssuming I have battery.

Assuming I have BW.

Page 12: Making awesome apps

Where the data is coming from?

My Server

3rd Party Servers

Page 13: Making awesome apps

Where the data is coming from?

My Server

3rd Party Servers

Page 14: Making awesome apps

Content Segmentation -What to Update?

What's Hot

Interesting stuff

Other

Page 15: Making awesome apps

BG Update

What's Hot

BG Update

Interesting Stuff

Other

Page 16: Making awesome apps

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

Page 17: Making awesome apps

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

GCM + Back-off

Page 18: Making awesome apps

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

GCM + Back-off

Daily / Bundled

Page 19: Making awesome apps

Updating Data from 3rd party servers

Monitor the deviceUse Variable alarms.

Use conditional services and receivers.

Monitor the user

Page 20: Making awesome apps

Is it worth waking up?

Set wake alarm for min update freq.

Set non-wake alarm for optimal update freq.

Page 21: Making awesome apps

Monitor device State

Change the refresh rate based on device state:

Update without connectivity?

Update more on WiFi?

Update more when charging?

Suspend updates on low battery?

Update more when docked?

Don't update in car dock?

Page 22: Making awesome apps

Monitor connectivity

Page 23: Making awesome apps

Monitor Battery

Page 24: Making awesome apps

Monitor State canged BCAST

Page 25: Making awesome apps

Monitor the user

Change your behavior based on the user's acitivty

Update more when driving?

Update more when walking?

Pause updates while cycling?

Page 26: Making awesome apps

Activity recognition

Page 27: Making awesome apps

Activity recognition

Page 28: Making awesome apps

Activity recognition

Page 29: Making awesome apps
Page 30: Making awesome apps

Being Invisible

I don't need to think how the app works.

I never notice the app's work.

I am never being bothered by the app.

Page 31: Making awesome apps

Work Offline

Queue and Send transactions.Use persistence layer.

Tape From Square.

Page 32: Making awesome apps

Work Semi-Offline

Be resilient to poor networks.Prioritize your transactions.

Be able to cancel transaction on the fly, or clear the Queue.

Adjust your apps behavior and timeouts accordingly.

Use Volley

Page 33: Making awesome apps

Use sync adapter to... sync

Sync adapter is great for sending data from the device to your server

Has a system wide POV.

Poor documentation, Hard to implement.

Page 34: Making awesome apps

Be efficient – Data usage

Page 36: Making awesome apps

Radio State Machine

IDLE

FACH

DCH

Power

~10Sec tail time

~12-75 Sec tail time

Bandwidth

Page 37: Making awesome apps

IDLE

FACH

DCH

Power

~10Sec tail time

~12-75 Sec tail time

~2 Sec

Bandwidth

Radio State Machine

Page 38: Making awesome apps

Avoid bursty traffic

Transmit data “together”.Piggyback if needed.

Pre-fetch data for the next 2-5 minutes.

Don't ping just to keep TCP connection aliveRRC != TCP Connection.

TCP connection is kept even in IDLE mode

Page 39: Making awesome apps

#1: Case study: Pandora

Music file streamed as single file.

Analytics data sends ~2KB every 62.5 seconds

Source: AT&T research

Page 40: Making awesome apps

#1: Case study: Pandora

0.2% of data consumed 46% of energy!

Page 41: Making awesome apps

Don't be HTTP rookie

Don't download what you already have.

Take care of server headersMax-age, expires.

Use conditional GET when cache expiresUse “last modified” header.

Server return 304, with no body.

Page 42: Making awesome apps

Don't be lazy

Read AT&T research:Top Radio Resources Issues in Mobile ApplicationsAT&T Lab Research – call for more efficient apps

Watch my latest reversim talk (video / slides )Use ARO.

Developed by AT&T.Monitors and analyze network activity. http://developer.att.com/https://github.com/attdevsupport/ARO

Page 43: Making awesome apps
Page 44: Making awesome apps

Adaptive App

Optimized for different User Experience.User has more than one device.

Be predictable.

Behave as expected

Page 45: Making awesome apps

Text Input

Specify the Edit Text input to show the right keyboard type.

use android:inputType attribute

Four classes of keyboards:Plain text

Decimal Number

Phone Number

Date or Time

Page 46: Making awesome apps

Text Input

Plain text types:URIs

Email address

People's names

Postal address

Passwords

Page 48: Making awesome apps

Context is critical

Activity recognition

Location

Page 49: Making awesome apps

GeoFencing

Page 50: Making awesome apps

Personal

G+ SSOLogin once – on all of your devices.

Track the user, not the device

Page 51: Making awesome apps
Page 52: Making awesome apps

Geek Magic – Text to Speech

Page 53: Making awesome apps

Geek Magic – Text to Speech

Page 54: Making awesome apps

Geek Magic – Text to Speech

Page 55: Making awesome apps

Geek Magic – Speech Recognition

Page 56: Making awesome apps

Geek Magic – Speech Recognition

More than one result is returned.

Loop through all results, taking context in mind.

Page 57: Making awesome apps

Summary

By Fresh

Be Invisible

Be Efficient

Be Adaptive

Be psychic

Page 58: Making awesome apps

[email protected]+Ran Nachmany

Thank You