Top Banner
The “Rounds Project” Growing from thousands to millions Tips and tricks from the battlefield
31

The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Aug 15, 2015

Download

Technology

DroidConTLV
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: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

The “Rounds Project” Growing from thousands to millions

Tips and tricks from the battlefield

Page 2: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

What is Rounds?

Page 3: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

What is Rounds?

Page 4: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

•Fun, eyecandy, social, viral, useful

Thank you Product Team!

•Scalable, fast, reliable, predictable backend

Thank you Server Team!

•Great Client side

That’s us! The Rounds Android Team

Yohay, Berry, Shay, Vadim and growing...

The Key for a Great App

Page 5: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

•Supporting as many devices,

OS versions and languages as possible

•Robust, Crash-free app

•Responsive UI, using latest guidelines

•Surprise & Delight the user

Great Client Side

Page 6: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Android 4.03 and above

Only about 8% of users use

Froyo, Gingerbread & below

so...

we only support 4.03 and above

(release quicker, use newer features).

Page 7: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Support 24 languages

For common iOS & Android translations

Page 8: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Support 7130 devices

QA?

Code Reviews

In house test most popular devices

Applause for testing all over the world

TestFairy for usability videos

Page 9: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Support 7130 devices

Release:

Start with 20% rollout

Crashlytics for amazing crash analytics

Increase after a few days

Page 10: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Responsive UI ?

•Used new Thread() every time

Oh no! Don’t do that!!

•Used synchronized on UI thread

Argh! Blocked it and got nasty ANRs!

•Fetched again the same info from server

Users had to wait…

Page 11: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Use a ThreadPool!

•Changed every call of

new Thread(someRunable).start();

•To

RoundsExecutor.get().execute(someRunable);

•And the result

With a few hours work

Amazing improvement in performance!

Page 12: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

public class RoundsExecutor {

private static ExecutorService sPool =

Executors.newCachedThreadPool();

public static ExecutorService get() {

return sPool;

}

private RoundsExecutor(){ }

}

Page 13: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

•synchronized, do you really need it?

avoid it completely on UI thread

if yes…

code review anyway

•pay attention where you are running.

if it is a callback then…

who is calling?

Parallel Threads Beware

Page 14: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

IntentService

•Creates a single background thread

•Will process only one task at a time

•Send the service an intent with what to do

Use LocalBroadcastManager

to broadcast event with result

Use a BroadcastReceiver

to handle result on UI thread

Page 15: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Managing Data

Model View

Controller

Page 16: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Managing Data

Model Persist Locally

Notify when changed

Servers

UI

Widgets

Activity or

Fragment

Fetch from Server

Page 17: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Managing Data

Model Persist Locally

Notify when changed

Servers

UI

Widgets

Activity or

Fragment

Fetch from Server Persist in Server

Page 18: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Managing Data

Model Persist Locally

Notify when changed

Servers

UI

Widgets

Activity or

Fragment

Fetch from Server GCM / XMPP Push Persist in Server

Page 19: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Managing Data

Model Persist Locally

Notify when changed

Servers

UI

Widgets

Activity or

Fragment

Fetch from Server GCM / XMPP Push Persist in Server

Page 20: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Persisting Data

We use

SharedPreferences for simple data

SQLLite for more complicated data

UniversalImageLoader for images

Page 21: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

We wanted an IntentService that would

•reschedule tasks that failed

•schedule tasks for later

•stay alive until we asked it to stop

github.com/rounds/rounds-android-goodies

FlexibleIntentService

Page 22: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

•Any component can broadcast events

using LocalBroadcastManager

•Any component can declare events

it is interested in and how to handle them

public interface RoundsBroadcastListener {

public String [] getInterests();

public void handleRoundsEvent(String

action, Bundle extras);

}

Event Pipeline

Page 23: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

We developed our handler

mHandler =

new RoundsEventHandler(context,

roundsBroadcastListener)

Base classes that implement the listener

And use our handler

RoundsActivityBase

RoundsFragmentBase

Event Pipeline

Page 24: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Start listening at onResume()

mHandler.registerReceivers();

Stop listening at onPause()

mHandler.unregisterReceivers();

github.com/rounds/rounds-android-goodies

Event Pipeline

Page 25: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Surprise & Delight

Page 26: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

yeti_eyes.xml

<animation-list android:oneshot="false" >

<item

android:drawable="@drawable/yeti_eyes_1"

android:duration="3000"/>

<item

android:drawable="@drawable/yeti_eyes_2"

android:duration="50"/>

…etc ….

</animation-list>

How to make a Yeti Blink

Page 27: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

How to make a Yeti Blink

•Create an animation-list xml resource

that lists frame by frame images

•To mimic a live object use

Random duration values

•On the ImageView you want to animate:

yetiEyes.setBackgroundResource(

R.drawable.yeti_eyes)

Page 28: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

How to make a Yeti Blink

Animate yetiEyes ImageView with

AnimationDrawable yetiEyesAnimation =

(AnimationDrawable) yetiEyes.getBackground();

yetiEyesAnimation.start();

Page 29: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds
Page 30: The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoahy Barsky, Rounds

Summary

•Make great product that people want to use

•Keep basic design principles in mind

•Use tools & services for crash free app

•Add Fun Surprises & Delights

•Can’t get it perfect the first time

•Keep learning and improve as you go