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]

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]

C2DM Prototype

As part of my current practicum project at CM-SV, I was asked to put together a prototype that demonstrates the capabilities of Google’s Cloud To Device Messaging (C2DM) service, or push notifications. What follows was the result: https://github.com/patrickbaumann/c2dmprototype c2dmprototype consists of two applications: a relatively vanilla Django server application (the Cloud part of C2DM) and an Android 2.2 application (the device part of C2DM). The demo aims to demonstrate the basic pieces of a “push to talk” application by allowing a user to send audio messages to devices by pushing them instead of requiring the battery-limited phone to poll the server. [Read More]