Percolate is happy to announce its second open source Android library, Foam. In October 2014, we brought you Caffeine, a utility library meant to help speed up Android application development. Foam continues our mission to give back to the open source community by building tools that help developers build better software.

There are a number of important things to consider when building great applications other than developing the newest feature. Notifications of crashes allows you to fix bugs as they appear. Tracking feature usage allows you to be smarter about what features you invest time in. Monitoring error logs allows you to fix unexpected issues. Crash notification, feature tracking, and error log monitoring all help optimize the user’s experience though continuous feedback. These are all important, but they usually get neglected or done poorly.

Foam’s mission is to make setting up crash reporting, event tracking, and log management extremely easy.

Foam currently supports the following services:

Crash ReportingEvent TrackingLog Management
PagerDutyFlurryPapertrail
PapertrailMixpanelLogentries
HockeyAppGoogle Analytics
FlurryGraphite

Here’s a quick example of how to use it.

A standard Android application has an Application object, such as this one:

public class MyApplication extends Application {
}

Now, let’s say you want to enable Google Analytics event tracking in your application. You would simply change your application class to this:

@FoamApiKeys(
googleAnalytics = "UA-00000000-1", // Tracking ID
)
public class MyApplication extends FoamApplication {
}

If you would like to enable Google Analytics, and Papertrail, and HockeyApp, but only on wifi, you would do this:

@FoamApiKeys(
googleAnalytics = "UA-00000000-1",
papertrail = "logs2.papertrailapp.com:49999",
hockeyApp = "b2044c3055d4066e5077f6088g7099h8",
wifiOnly = true
)
public class MyApplication extends FoamApplication {
}

That’s it! Usage data would be sent to Google Analytics, error logs sent to Papertrail, and crashes sent to HockeyApp.

If a developer is not using Foam, each of these services would require custom integration into your application. You would have to read the developer documentation, find supporting libraries for each, then monitor crashes, events, and logs manually. This is can take quite a bit of time to do correctly. Using Foam, we have turned this into a very simple process. Now all you need to do is sign up for the services you want to use and watch the data roll in.

Another great use of Foam is to compare similar services before choosing one. For example, you could very quickly enable event tracking on Flurry, Mixpanel, Google Analytics, and Graphite. All of these services will receive the same data making it easier to compare services when trying to choose which one works best for you.

One major accomplishment with Foam is the fact that it is the only Android library available for Graphite, Papertrail, and Logentries. No small feat!

At percolate we use open source extensively. In turn we have also given back to the open source community over the past years, and plan to continue to do so. Next on the horizon will be to create an iOS version! Stay tuned. In the meantime, if you are interested in using Foam or learning more, take a look at the extended documentation.

If you are interested in working on awesome applications and projects such as this one, good news! —We are hiring.