Gyuri Grell

sharing my wisdom with the world

Have you ever wanted to have a better idea of what's the best source of your app installs? There's information around the web on how to do it, but spread out over various sites, so I decided to write this post to consolidate the information.

Starting with Android 1.6, the Android Market's emits a broadcast Intent named whenever certain parameters are added to the market url. Note that web version of the Market also passes these parameters to your devices upon install. Since the parameters need to follow the Google Analytics referral link format, Google provides a simple tool for generating these urls, or you could use a copy of my shared Google spreadsheet that I use to keep track of all my campaigns. Here's a description for the important parameters:

utm_campaignUsed for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign. 
utm_mediumUse utm_medium to identify a medium such as email or cost-per- click. 
utm_sourceUse utm_source to identify a search engine, newsletter name, or other source. 

So now you have a url with information that is broadcast by the Android Market when your app is installed. The next step is to capture that information inside your app and submit them to your mobile analytics provider (Google Analytics, Flurry, Localytics, etc). The way to do that is to first register a BroadcastReceiver in your AndroidManifest.xml. You'll need to handle the broadcast like this:

Next we need the implement the class that handles the broadcast. All the class does is receives the INSTALL_REFERRER BroadcastIntent, takes the 'referrer' extra from the intent and breaks it down into key/value pairs for submitting it to the analytics package. (AnalyticsTrackerFactory is the Gist is just my generic wrapper for analytics; you can call your own directly instead).

So that's all there is to it! Just take some vary basic steps and small changes to your app to easily track who's referring downloads of your app.

Have you ever run into the error "Incorrect AVA format" when trying to sign an Android APK with a new key? It turns out this useless error more than likely means that you have used some illegal character in the signing data. In my case, I had used a comma in the company name which isn't allowed for some reason. Just remove any extra characters and you should be good to go!

Poster thumbnailTroodon Software LLC has released a fantastic class library poster for Android development in PDF format, so you can print it out and hang it on your wall for quick reference.

Download PDF

Download Visio format

EDIT: Updated links

Help text

To help make our Android applications look even more professional, we can include HTML formatted text and display it in a WebView. Here's the simplest way I've found to have local HTML, image and style files and display them. This is the same process I use to display help in Grandma Jong.

First, I've stored all my files in a subfolder of assets. This will make it easier to load the HTML, and via some built-in functionality in Android, it will load all assets from the same folder as well. Here's a screenshot of the assets folder:

Assets folder

Here I have the HTML file, along with the referenced images. Now a glance into what the HTML looks like:

<img src="bomb.png" align="left" style="margin-right:1em;" /> Don't despair! Bomb tiles let you clear blocked tiles; just select the tile to remove, then select a bomb tile on the left. A matching tile will be removed from the level.

The <img> tag just has a straightforward reference to the image file, since when loading the HTML, the passed in path will be taken as the root path and all references are valid from there. Finally, there's the WebView code needed to load the HTML from the assets folder. Once you have a reference to a WebView instance, all you need to do is call the loadUrl method on it:


The "file:///android_asset" path is a special one that points to the assets folder in your project. That's all there is to it. Although I haven't demonstrated it here, you can also store and load style and javascript files the same way.

RPX provides universal authentication via various OAuth providers like Google, Facebook, Yahoo, Twitter, etc. They now have an implementation available for iPhone developers. Hopefully they'll have an Android version soon as well.

Posted via web from Gyuri Grell's posterous

Example materials that you can use to create your icons.

The Android Icon Design Guidelines have been updated to describe the latest design styles of iconography in versions 2.0+. The styles have changed dramatically from pre-2.0 days, so be sure to read the whole document.

There are also some nice Photoshop templates that can be download from here.

(via Roman Nurik)

train tracks
Flickr photo by _fLeMmA_

It has been a long couple of months from before Thanksgiving straight through Christmas and New Years and I was very busy during those times. I didn't get a whole lot done on anything Android related, including working much on my first app to be published to the Android Market, titled Grandma Jong.

Now I'm back on track, and put in a lot of work over the last week or so into getting it ready for a beta test. I'll post here when it is ready, but in the meantime, here are a couple screenshots:

Main menu

Choose a level

Main gameplay

Completed the level

Barcamp DC photo by jgarberI'm really excited about attending the third local BarCamp in DC tomorrow! Yep, we're already on our third one here locally (not to mention all the others happening in the Baltimore-Washington D.C. area). I'm planning on co-presenting on Android development with Zvi Band. I'll be showing a simple graphical app with animation and touch screen input.

I'm also using this opportunity to launch the first in a series of articles on Android development, gradually improving this simple app into something useable in a real app involving animations and graphics. Stay tuned, I'll be posting the first article here sometime next week.

Google WaveI have 5 Google Wave invites available. First 5 comments below will receive the invites. Remember to include your email address!


[EDIT: All gone. I'll post again if I get any more.]

Android donutVersion 1.6 of the Android SDK has been released to developers. Though this isn't a major release, there are quite a few tasty updates that I'm looking forward to (both as a user and a developer).

For users, updates include:

  • Quick search box - The Android search mechanism has been redesigned to be able to search across multiple data sources including bookmarks, history, contacts, web, etc. It also is smart enough to bubble up the more commonly used results.
  • The camera, camcorder and gallery have been simplified and made quite a bit faster than before.
  • VPN support has been added.
    • L2TP/IPSEC pre-shared key based VPN
    • L2TP/IPsec certificate based VPN
    • L2TP only VPN
    • PPTP only VPN
  • A bettery usage indicator which shows you how much each of your running apps is consuming so that you can stop those that kill your battery.
  • Better accessibility support.
  • A much improved Android Market that addresses many of the concerns that users and developers had with the market. These changes also help discoverability and doesn't hide paid apps.

For developers:

  • An API to handle the expanded search framework used by then quick search box.
  • A new multi-lingual text to speech engine called Pico. It allows any Android application to "speak" a string of text with an accent that matches the language, and supports English (American & British), French, Italian, German and Spanish.
  • A new gestures API for creating and reusing gestures, and associating it with actions.
  • Extended support for varying screen resolutions and densities. This will become more important as WVGA and QVGA devices come to market.
  • Telephony support for CDMA
  • A newer version of OpenCore media engine with additional codec support and improved buffering.