Android Development War
Stories
by Lope Emano
April-June 2014
Seriously though.
The Format
Share and discuss experiences in an app
you’ve built and/or the new things you’ve
learned the past few months.
Things I’ve learned the past few months
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
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
Libraries
Guava
- Light and useful
- Used only MultiMap and StringUtils
- Still have a lot to learn!
No need for ActionBarSherlock
- Android support library can now suffice
Butterknife
❖ Very light weight
❖ @InjectView, @Click, @OnItemClick,
@InjectView within ViewHolder
❖ A Jake Wharton project
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
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 [ ]
EventBus
“Eventbus is one of the most badass things
that has happened to me as an android
developer”
-Lope Emano
When I saw those two slides, I didn’t
really realize what it implied.
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
Why EventBus can be dangerous
Prone to memory leaks
EventBus 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 Addictive
EventBus even when you don’t need it and thus
ending up with an app with so many events
Check it out!
http://www.slideshare.net/greenrobot/eventbus-for-android-15314813
My hardest battle
❖ 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.
AsyncTask
❖ Worked well but when I left the activity the
I/O stream for reading the image would
get closed.
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
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.
RoboSpice got me to where I wanted but
then I realized I wanted something more- an
offline mode for the app.
Android Priority JobQueue
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)
Comprehensive sample available!
https://github.com/path/android-priority-
jobqueue/tree/master/examples/twitter
Thanks!

Android development War Stories

  • 1.
    Android Development War Stories byLope Emano April-June 2014
  • 4.
  • 5.
    The Format Share anddiscuss experiences in an app you’ve built and/or the new things you’ve learned the past few months.
  • 6.
    Things I’ve learnedthe past few months
  • 7.
    New Design-First processis 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
  • 8.
    New Design-First processis 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
  • 9.
  • 10.
    Guava - Light anduseful - Used only MultiMap and StringUtils - Still have a lot to learn!
  • 11.
    No need forActionBarSherlock - Android support library can now suffice
  • 12.
    Butterknife ❖ Very lightweight ❖ @InjectView, @Click, @OnItemClick, @InjectView within ViewHolder ❖ A Jake Wharton project
  • 13.
    Ormlite ❖ ORM forSQLite w/ android support ❖ annotations for field -> property mapping ❖ powerful Dao ❖ learned about extending BaseDao ❖ still figuring out how connections get closed
  • 14.
    FTS/Full Text Searchon 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 [ ]
  • 15.
    EventBus “Eventbus is oneof the most badass things that has happened to me as an android developer” -Lope Emano
  • 18.
    When I sawthose two slides, I didn’t really realize what it implied.
  • 19.
    Why EventBus isa 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
  • 20.
    Why EventBus canbe dangerous Prone to memory leaks EventBus 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 Addictive EventBus even when you don’t need it and thus ending up with an app with so many events
  • 21.
  • 22.
  • 23.
    ❖ I neededto upload some images to a server in a background thread. ❖ I needed to move around the app without the upload getting cancelled.
  • 24.
    AsyncTask ❖ Worked wellbut when I left the activity the I/O stream for reading the image would get closed.
  • 25.
    Volley ❖ Popular dueto 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
  • 26.
    RoboSpice ❖ Launched aservice to do long running background processes ❖ Was relatively easy to set up. ❖ There was a learning curve but it wasn't that steep.
  • 27.
    RoboSpice got meto where I wanted but then I realized I wanted something more- an offline mode for the app.
  • 28.
  • 29.
    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)
  • 30.
  • 31.