Add mercurial or git changeset id to your Android app

We recently automated the debug builds of our Android app. As a result, we wanted to include the Mercurial changeset id in our app settings, so we could quickly tell what version of the app someone was running. What we ended up doing was writing the changset id to a custom properties file that was then copied into the raw directory during a build. That properties file could then be read by our...

Read More

Android app build automation with Hudson

In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. This post assumes you have a working ci server running Hudson (or Jenkins). First download and install the Android SDK to your Hudson server. Make sure it’s in a directory...

Read More

Localized Javascript countdown

These days many websites use a simple Javascript countdown clock to help promote the launch of a new service. Because many web applications are international, it’s important to ensure that your countdown is localized for all visitors. Let me give you an example. Say you’re in Portland, OR and you’re launching a new web app on April 27, 2011 at 5:00 p.m. PST. Not only are you...

Read More

Multiple Base Templates in Django

I’ve been working on a pretty big project at work that’s heavily oriented towards mobile devices. We have a Django site running with a lot of custom ecommerce code, but wanted to serve up an optimized experience for mobile devices. There are a lot of ways to do this, but ultimately we wanted to serve up a different base template for visitors on small-screen mobile devices. We wrote a...

Read More

Simple clock using standard Javascript

Ah the challenge for making your first clock in Javascript, I remember those days. It seems like such a daunting task at first, but it’s really quite simple....

Read More

Detecting mobile devices with Javascript

Today at work we were struggling with a way to detect the iPad and similar devices without relying on the browser user agent string. We ended up checking the value of window.onorientationchange like so: function is_mobile_device() { if (typeof window.onorientationchange != "undefined") { return true; } else { return...

Read More