android development war stories

36
Android Development War Stories by Lope Emano April-September 2014

Upload: lope-emano

Post on 02-Dec-2014

135 views

Category:

Software


5 download

DESCRIPTION

June - September 2014

TRANSCRIPT

Page 1: Android development war stories

Android Development War Stories

by Lope EmanoApril-September 2014

Page 2: Android development war stories
Page 3: Android development war stories
Page 4: Android development war stories

Seriously though.

Page 5: Android development war stories

The Format

Share and discuss experiences in an app you’ve built and/or the new things you’ve learned the past few months.

Page 6: Android development war stories

Things I’ve learned the past few months

Page 7: Android development war stories

New Design-First process is kewl

First two weeks:❖ Researched existing similar apps

(advantages and disadvantages)❖ Watched Android Design In Action videos❖ Sketched designs/layouts using pencil and

paper via printed out stencil kit

Page 8: Android development war stories
Page 9: Android development war stories

Currently in my wishlist, waiting for Material version

Page 10: Android development war stories

New Design-First process is kewl❖ Demo app to product owner in front of

photoshop for insta changes❖ Acquaint designer with terms like "actionbar,

navigation bar, status bar, overflow" for easy communication

❖ Android asset studio❖ Look around for potential tools❖ Sketch (mac app w/ android plugin) seems to

be gaining traction and is considered as a better alternative to PS.

Page 11: Android development war stories

IDE

Page 12: Android development war stories

Android Studio

❖ Used it and haven’t looked back since❖ IntelliJ is still supporting its android plugin❖ Gradle + gradle integration is relatively faster

than Maven❖ You can port eclipse shortcuts to Android

Studio, it’s a built in config.

Page 13: Android development war stories

Libraries

Page 14: Android development war stories

Guava

- Light and useful- Used only MultiMap and StringUtils- Still have a lot to learn!

Page 15: Android development war stories

No need for ActionBarSherlock

- Android support library can now suffice

Page 16: Android development war stories

Butterknife

❖ Very light weight❖ @InjectView, @OnClick, @OnItemClick,

@InjectView within ViewHolder❖ You can inject your ViewHolder❖ A Jake Wharton project

Page 17: Android development war stories

Ormlite

❖ ORM for SQLite w/ android support❖ annotations for field -> property mapping❖ powerful Dao❖ learned about extending BaseDao❖ still figuring out how connections get

closed

Page 18: Android development war stories

GreenDao

❖ ORM designed to be fast and lightweight❖ way faster than ORMLite❖ Asynchronous API

Page 19: Android development war stories

FTS/Full Text Search on SQLite

❖ Found out FTS is supported on SQLite❖ Not supported on ORMLite so used

SQLCursor❖ Limited to prefix search:

“a” will return [“apple”, “anderson”]“pple” will return [ ]

Page 20: Android development war stories

EventBus

“Eventbus is one of the most badass things that has happened to me as an android developer”

-Lope Emano

Page 21: Android development war stories
Page 22: Android development war stories
Page 23: Android development war stories

When I saw those two slides, I didn’t really realize what it implied.

Page 24: Android development war stories

Why EventBus is a lifesaver

❖ No need to pass ids between activities via intent bundles

❖ Passing objects from activities to fragments is much easier

❖ Said my goodbye to parcelables❖ Communication from background thread to

main thread is easier

Page 25: Android development war stories

Why EventBus can be dangerous

Prone to memory leaksEventBus stores a listmap of subscribers of

different types of events. If you forget to unregistered a registered object then eventbus will hold that object forever

Very AddictiveEventBus even when you don’t need it and thus

ending up with an app with so many events

Page 26: Android development war stories

Check it out! http://www.slideshare.net/greenrobot/eventbus-for-android-15314813

Page 27: Android development war stories

My hardest battle

Page 28: Android development war stories

❖ I needed to upload some images to a server in a background thread.

❖ I needed to move around the app without the upload getting cancelled.

Page 29: Android development war stories

AsyncTask

❖ Worked well but when I left the activity the I/O stream for reading the image would get closed.

Page 30: Android development war stories

Volley❖ Popular due to I/O presentation❖ Found a hard time to find the source code

and jar files plus I found something more mature and well documented

❖ I think google is planning on integrating this with SDK

❖ Mirrors available

Page 31: Android development war stories

RoboSpice❖ Launched a service to do long running

background processes❖ Was relatively easy to set up. ❖ There was a learning curve but it wasn't

that steep.

Page 32: Android development war stories

RoboSpice got me to where I wanted but then I realized I wanted something more- an offline mode for the app.

Page 34: Android development war stories

Android Priority Jobqueue (Job Manager)

❖ Path project written mostly by yigit❖ Supported Offline Mode❖ Supported Network State Listeners❖ Supported Job Priority❖ Supported Job Sequencing❖ Supported Dependency Injection (was

able to integrate it easily with dagger)

Page 35: Android development war stories

Comprehensive sample available! https://github.com/path/android-priority-jobqueue/tree/master/examples/twitter

Page 36: Android development war stories

Thanks!