BundleButler: Simplifying arguments and savedInstanceState

To make proper use of both Fragment arguments and saved instance state in Android, I found myself frequently writing a great deal of the same boilerplate code. Most of that code looked like this: public class EditEntryFragment extends Fragment { private Entry entry; private String title; private boolean hasAgreedToTerms = false; public static EditEntryFragment createInstance(Entry currentEntry, String title) { EditEntryFragment fragment = new EntryEditFragment(); Bundle args = new Bundle(); args.putParcelable("entry", currentEntry); args. [Read More]

Amazon Fresh Bookmarklet

I recently started my trial month of Amazon Fresh and was a bit disappointed in the lack of integration the service has with Amazon.com. Specifically, there doesn’t appear to be a way to add to your Fresh cart from Amazon.com. I understand the need for different carts, but don’t understand why I can’t send to Fresh or transfer between the two. So I’ve created a quick and dirty bookmarklet that will open an Amazon ASIN in Fresh for quick addition to your cart. [Read More]

Indispensable Android Libraries

With recent surge in adoption of the new Gradle-based Android build system, it’s easier than ever to incorporate Android library projects (and libraries in general) into your project. Gone are the days of complex pom files, submodules, forked repos, a huge libs folder or worst of all, copying code as-is into your repo (you never did that, right?). Now a full Android library or utility can be included with a one-line addition to your build. [Read More]

Improving RoboGuice Application Start Times

RoboGuice is a fantastic dependency injection framework for Android that wraps Google’s Guice DI library with a set of helper classes and default injections that can make an Android developer’s life much easier. Unfortunately, this comes at a cost. Guice was not designed with mobile devices in mind and instead targets servers where objects startup is long but once you’re up, responses need to be quick. Because of this, startup times for apps using RoboGuice can be noticably long in the best case and uncomfortably long if you’re not careful. [Read More]

DI on Android Without the Startup Cost: dagger

Anyone who has used a dependency injection (DI) framework on a project can likely speak to its benefits when creating complex systems. Relying on it can help an engineer to design and implement clean, testable software. Anyone who has tried to write Android applications using a DI framework has likely been disappointed in some degree with current offerings. DI frameworks in Java have largely been written with server architectures in mind and as such are either generally too resource heavy to work on a mobile device. [Read More]

Gson & Deserialization of Objects Containing Arrays

After my practicum team and I banged our collective heads against the wall for several hours trying to force Gson to deserialize json arrays into a collection of complex classes containing their own collections, we chose to go another route entirely. Our problem at the time was that we had blinders on and couldn’t walk away from using Javas Collections library. I came to realize today that Gson does a fantastic job of deseralizing classes with any depth of arrays so long as those json arrays are actually represented as primitive arrays in your java class. [Read More]

Android: Widgets and Library projects

On a recent project I’m working on with my AppJour team, we chose to use the DateSlider widget for date selection in lieu of the standard DatePicker and TimePicker views provided in the Android SDK. The installation instructions involve copy-pasting various layouts and java files in with our source. While that may work, it clutters our res folders and introduces source code that we don’t want to take explicit ownership of. [Read More]

Enjoying My Mornings With a Double Edge Razor

After more than a decade of shaving with your typical cartridge-based safety razor, I figured there had to be something better. Getting a close shave with one often means horrible razor burn and ingrown hairs: not a good way to start my day. So after asking my barber for some advice, I was pointed in the direction of the classic straight razor or the double edge razor that was popular in my grandparents' generation. [Read More]

Twitter as a Software Engineering Process Tool

It was recently suggested by my practicum teammate, @samdkarp, that in lieu of formal daily “stand-up” meetings to support our agile software process we use Twitter to share our daily status. For a remote, part-time team with a variety of schedules we thought that this might be a good approach, allowing us to share status at our convenience. So far it has been a great way to coordinate; we’ve committed to at least daily updates so that we can have impromptu pairing sessions as team members are available. [Read More]