@font-face: A Small Revolution

I just used the @font-face CSS rule to change the font of this website and use a nicer one: Open Sans.

@font-face is supported by all modern desktop browsers, including IE (since version 5.5!). The stock Android browser also supports it, but I have no idea about iOS or Windows Phone.

How does it work? It’s very simple: you define a custom font-family using a @font-face CSS rule:

@font-face {
  font-family: "My Font"; /* Name of the new font-family we are creating */
  src: url(http://full.url.of/the-font.odf);
  font-weight: 400; /* Default weight for "normal" text */
}

You can then use the custom font in any font-family rule:

p {
  font-family: "My Font", Verdana, Arial, sans-serif;
  font-size: 13px;
}

If the browser doesn’t support @font-face, it will fallback to the next font in the list, as usual.

The very nice thing is that Google decided to publish 500+ free-to-use fonts: enter the Web Fonts project. The online dashboard allows you to select the fonts you want to use in your website, and link to them with a simple <link rel="stylesheet" /> tag pointing to Google’s fast CDN and including all the selected fonts.

@font-face seems to have been around for a while, but I must have missed it. It’s actually a very brilliant yet simple solution to escape the boring typical Verdana, Arial, sans-serif font-family declarations we see on most websites.

Achievement Unlocked: 10k Downloads

Today Folder Downloader for Dropbox hit 10k downloads*. It’s nothing spectacular, obviously, but it’s a good result to reach in less than 4 months with no advertising for such a niche application.

This, BTW, makes it even clearer how good centralized stores are for distributing software.

A weird fact I’ve noticed is that for apps in the same category – Productivity – 51% of active device installs are on 2.3 Gingerbread, and almost 25% on 4.0 Ice Cream Sandwich. For Folder Downloader I see opposite figures: 53% on 4.0 and 25% on 2.3. Even more interesting, almost 10% of active Folder Download users are already on 4.1 Jelly Bean, while only 1.6% of overall Productivity apps users run the newest Android version.

For some reason, Folder Downloader and/or or Dropbox users have more up-to-date phones than average.

On the other hand, I’m a bit disappointed that only 54% of users keep the app installed over time. There’s obviously room for improvement.

* As I started writing this post a few hours ago, then paused and got dragged into work, I saw more than 10k downloads. Later today Google notified app publishers that there was a download counting problem. The correct count is a couple hundreds short of 10k downloads, which will anyway be reached in less than 2 days.

Adaptive Layout With CSS Media Queries

I’ve been playing a bit with CSS3 Media Queries to get this blog’s layout adaptive. I’m not going into the details because I used a trial-and-error process and I’m not yet 100% sure everything works. I considered these aspects:

  • the sidebar with the bio, archives and so on is of least importance, so it’s hidden when the viewport is smaller than a certain size
  • some elements are hidden with the same criteria, most notably the Twitter, Google+ and Facebook share buttons (which are also not rendered at all on mobile browsers to save bandwidth and processing power, and it shows, even on a dual-core Android 4 device)
  • some elements are moved, or their style is changed (post date/time, search bar)
  • main margins are reduced to save space on smaller screens.

To experience the result even without a mobile device, simply resize your browser window. In case you’re lazy, this is the result:

My First Android App

I just published my first Android app: Folder Downloader for Dropbox. The name should describe it pretty well. As it happens most of the time, I scratched my own itch.

This is my very first attempt at Android development. My verdict: it sucks. Not my app, Android development. Perhaps my app sucks as well, but that’s not the point.
The point is, Android development is complex, messy, quirky and unobvious. The documentation is horrible. Eclipse is awful, at least compared to Visual Studio. The emulators are slow as hell. Google Play’s Developer Console feels like it was slammed together by drunk monkeys (actually, that’s also true for the Android SDK itself).

But, I’m quite happy with the result. Being the paranoid nitpicker that I am, I can say I have achieved all the main objectives I had in mind (not requiring the user’s Dropbox password, mimicking the look-and-feel of the official Dropbox’s app, and running the download in background, via a service).

Download, enjoy and rate.