Skip to content

Instantly share code, notes, and snippets.

@sergenes
Created July 28, 2015 17:09
Show Gist options
  • Save sergenes/a67811d7d2b260c2f65b to your computer and use it in GitHub Desktop.
Save sergenes/a67811d7d2b260c2f65b to your computer and use it in GitHub Desktop.
"Android development War Stories"
1. Android Development War Stories by Lope Emano April-June 2014
2. Seriously though.
3. The Format Share and discuss experiences in an app you’ve built and/or the new things you’ve learned the past few months.
4. Things I’ve learned the past few months
5. 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
6. 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
7. Libraries
8. Guava - Light and useful - Used only MultiMap and StringUtils - Still have a lot to learn!
9. No need for ActionBarSherlock - Android support library can now suffice
10. Butterknife ❖ Very light weight ❖ @InjectView, @Click, @OnItemClick, @InjectView within ViewHolder ❖ A Jake Wharton project
11. 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
12. 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 [ ]
13. EventBus “Eventbus is one of the most badass things that has happened to me as an android developer” -Lope Emano
14. When I saw those two slides, I didn’t really realize what it implied.
15. 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
16. 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
17. Check it out! http://www.slideshare.net/greenrobot/eventbus-for-android-15314813
18. My hardest battle
19. ❖ 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.
20. AsyncTask ❖ Worked well but when I left the activity the I/O stream for reading the image would get closed.
21. 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
22. 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.
23. RoboSpice got me to where I wanted but then I realized I wanted something more- an offline mode for the app.
24. Android Priority JobQueue
25. 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)
26. Comprehensive sample available! https://github.com/path/android-priority- jobqueue/tree/master/examples/twitter
27. Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment