Making awesome apps

Post on 27-Jan-2015

126 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

Transcript

From good to awesome

Always up to date

Users don't like to wait. Location updated.

Data downloaded from web.

Always up to date

Users don't like to wait. Location updated.

Data downloaded from web.

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.

Fused Location

Define your priorities

Let Google play services do the heavy lifting.

Using fused location

Data updates

The challenges:

When to update?

Where the data is coming from?

What to update?

How to update?

When to update my App?

Right before the user launches itAssuming I have battery.

Assuming I have BW.

Where the data is coming from?

My Server

3rd Party Servers

Where the data is coming from?

My Server

3rd Party Servers

Content Segmentation -What to Update?

What's Hot

Interesting stuff

Other

BG Update

What's Hot

BG Update

Interesting Stuff

Other

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

GCM + Back-off

BG Update

What's Hot

BG Update

Interesting Stuff

Other

GCM Embedded

GCM + Back-off

Daily / Bundled

Updating Data from 3rd party servers

Monitor the deviceUse Variable alarms.

Use conditional services and receivers.

Monitor the user

Is it worth waking up?

Set wake alarm for min update freq.

Set non-wake alarm for optimal update freq.

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?

Monitor connectivity

Monitor Battery

Monitor State canged BCAST

Monitor the user

Change your behavior based on the user's acitivty

Update more when driving?

Update more when walking?

Pause updates while cycling?

Activity recognition

Activity recognition

Activity recognition

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.

Work Offline

Queue and Send transactions.Use persistence layer.

Tape From Square.

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

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.

Be efficient – Data usage

Radio State Machine

IDLE

FACH

DCH

Power

~10Sec tail time

~12-75 Sec tail time

Bandwidth

IDLE

FACH

DCH

Power

~10Sec tail time

~12-75 Sec tail time

~2 Sec

Bandwidth

Radio State Machine

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

#1: Case study: Pandora

Music file streamed as single file.

Analytics data sends ~2KB every 62.5 seconds

Source: AT&T research

#1: Case study: Pandora

0.2% of data consumed 46% of energy!

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.

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

Adaptive App

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

Be predictable.

Behave as expected

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

Text Input

Plain text types:URIs

Email address

People's names

Postal address

Passwords

Context is critical

Activity recognition

Location

GeoFencing

Personal

G+ SSOLogin once – on all of your devices.

Track the user, not the device

Geek Magic – Text to Speech

Geek Magic – Text to Speech

Geek Magic – Text to Speech

Geek Magic – Speech Recognition

Geek Magic – Speech Recognition

More than one result is returned.

Loop through all results, taking context in mind.

Summary

By Fresh

Be Invisible

Be Efficient

Be Adaptive

Be psychic

ran@mobiliup.com+Ran Nachmany

Thank You

top related