A library to quickly and easily enable multiple monitoring & support platforms for your mobile apps

Related tags

Utility foam
Overview

You have a small team. Setting up crash reporting tools, event tracking tools, and log management services is not what you want to spend your hours doing. You know these are important to the health of your application, but you just want to code.

That's where Foam comes into play. Want to use Flurry and Papertrail in your app? No problem:

@FoamApiKeys(
    flurry = "S6S7S8S9S0S1S2S3S4S5", // API Key
    papertrail = "logs2.papertrailapp.com:49999" // Server URL
)
public class MyApplication extends FoamApplication {
}

Want to use Google Analytics, PagerDuty, and Logentries? Sure...

@FoamApiKeys(
    googleAnalytics = "UA-00000000-1", // Tracking ID
    pagerDuty = "3a3b3c3d3e3f3g3h3i3j3k3l3m3n3o3p", // API Key
    logentries = "data.logentries.com:12345" // Server URL
)
public class MyApplication extends FoamApplication {
}

You add your API Keys, we'll do the rest.

Supported Services

Crash Reporting Event Tracking Log Management
PagerDuty Flurry Papertrail
Papertrail Mixpanel Logentries
HockeyApp Google Analytics
Flurry Graphite

Crash Reporting: Unhandled exceptions will be reported.

Event Tracking: Activity launches will be tracked.

Log management: Error logs from devices will be reported.

Setup All The Things

@FoamApiKeys(
    pagerDuty = "3a3b3c3d3e3f3g3h3i3j3k3l3m3n3o3p",
    papertrail = "logs2.papertrailapp.com:49999",
    hockeyApp = "b2044c3055d4066e5077f6088g7099h8",
    flurry = "S6S7S8S9S0S1S2S3S4S5"
    mixpanel = "221b331c441d551e661f771g881h991i",
    googleAnalytics = "UA-00000000-1",
    logentries = "data.logentries.com:12345",
    graphite = "[api-key@]graphite.myhost.com:2003"
)
public class MyApplication extends FoamApplication {
}

That's it. You've just enabled all of these services for your application. Well, almost. Make sure you also have the following set:

  1. Internet permission in your AndroidManifest.xml:

     <uses-permission android:name="android.permission.INTERNET" />
    
  2. SDK level 14 or higher in build.gradle:

     minSdkVersion 14
    
  3. Define your custom Application class in your AndroidManifest.xml:

     <application
         android:name="com.your.app.MyApplication"
    
  4. Add dependencies for Foam, Retrofit, and Gson in build.gradle:

     compile 'com.percolate:foam:0.9.4'
     compile 'com.squareup.retrofit:retrofit:1.9.0'
     compile 'com.google.code.gson:gson:2.3'
    

Where to find your API Keys:

HockeyApp: Click your name (top right) -> API Tokens -> Create an API token. (permissions can be set to "Read Only")

Mixpanel: Your project 'Token' can be found under "Update project settings" (gear icon on the bottom left).

PagerDuty: Configuration -> API Access -> Create API Key

Papertrail: Add a system. You'll see "Your systems will log to <url>". Use this URL.

Logentries: Add a new log -> Select Manual (Gear icon) -> Change "How are the logs sent?" to "Plain TCP, UDP - logs are sent via syslog." -> Click create. You will get back "Start sending logs to <url>". Use this URL.

Google Analytics: Create a new Property -> Select "Mobile App" -> Click "Get Tracking ID".

Flurry: Create an application in Flurry then add your application key. (FlurryAnalytics-x.x.x.jar must be added manually to your project {TODO document in wiki})

Graphite: Provided by the maintainer of your graphite host.

Notes:

  • It takes time for some services to process incoming data. There may be a delay of few hours before anything shows up. Be patient.
  • Like other crash reporting tools, crashes are sent when the user reopens the app after a crash. Keeping an app open to send data during a crash would lead to other problems, such as ANRs.
  • Does you application currently extend MultiDexApplication? No problem, just use our FoamMultiDexApplication version instead.
  • Can't extend FoamApplication or FoamMultiDexApplication for some reason? That's fine too. Make your application class implement our FoamApp interface, and create an instance of FoamMain in onCreate. See FoamApplication.java for an example.
  • If your application may be sending lots of data, you may want to set wifiOnly = true on the @FoamApiKeys annotation.
  • You can use FoamEvent#track(Activity activity, String event) to track custom events.
  • You can use FoamDisabler#disable() to disable Foam, and FoamDisabler#reenable() to turn it back on. Useful to hook up to a "Do not track" user setting.

Why no Crashlytics?

We had it. Then we removed it.
Crashlytics requires some custom setup. There is no way around this.
After which, enabling crashlytics is a single line of code Crashlytics.start(this).
This tool would not lessen setup, configuration, or required coding coding as it does with the other services we support.
If Crashlytics were to ever support manual configuration or provide an API to submit crashes, we will add it.
In the meantime, if you wish to use Crashlytics in your application, instructions can be found here.

TODO

iOS version: Coming soon
Services to add: Loggly

If you would like to add a new service please create a pull request. A good example of what is required is contained in our Adding Graphite PR.

Feel free to open a new issue for platforms you would like to see added.

License

Open source. Distributed under the BSD 3 license. See LICENSE for details.

You might also like...
Mirko asked me to produce a demo with mobile dots.

Alchemist Primer This is a template project to spawn projects using the Alchemist Simulator. It provides a pre-configured gradle build. This project i

📱 objection - runtime mobile exploration
📱 objection - runtime mobile exploration

objection is a runtime mobile exploration toolkit, powered by Frida, built to help you assess the security posture of your mobile applications, without needing a jailbreak.

Small Android library to help you incorporate MVP, Passive View and Presentation Model patterns in your app
Small Android library to help you incorporate MVP, Passive View and Presentation Model patterns in your app

DroidMVP About DroidMVP is a small Android library to help you incorporate the MVP pattern along with Passive View and Presentation Model (yes, those

SharedPreference Library to save all types including your custom types and observe them if need be.

A SharedPreference Library that can be used to store all types including your custom classes and observe them too if needed.

compaKTset is a small library aimed at providing you with the most memory efficient Set implementation for any particular data type of your choosing.

compaKTset is a small library aimed at providing you with the most memory efficient Set implementation for any particular data type of your choosing.

A beautiful set of predefined colors and a set of color methods to make your Android development life easier.
A beautiful set of predefined colors and a set of color methods to make your Android development life easier.

Colours is a port of the Colours Library for iOS made by my good friend Ben Gordon. You can find that project here. Installation Maven Central Colours

[] Define and render UI specs on top of your Android UI
[] Define and render UI specs on top of your Android UI

dspec A simple way to define and render UI specs on top of your Android UI. Usage Enclose the target UI with a DesignSpecFrameLayout, usually the root

Utility for detecting and notifying when your Android app goes background / becomes foreground

Foredroid Utility for detecting and notifying when your Android app goes background / becomes foreground. API-level 14+. Usage: Initialise Foreground

High level parsing to ensure your input is in the right shape and satisfies all constraints that business logic requires.

Parsix High level parsing to ensure your input is in the right shape and satisfies all constraints that business logic requires. It is highly inspired

Comments
  • Add the ability to disable and re-enable tracking features.

    Add the ability to disable and re-enable tracking features.

    Dev's should be able to turn Foam features on/off programmatically if required. A good example is a "Do not send usage data" user preference.

    opened by brentwatson 1
  • How to send Custom Log Information to Papertrail

    How to send Custom Log Information to Papertrail

    Hi,

    This is not really an issue but couldn't find it in your ReadMe File. I want to send some of Logs to Papertrail, but as far as I could see in your documentation, once I set it up, it will log everything to Papertrail.

    What I want to do is more like sending a Log Message to Papertrail if I really need to. I don't need Crashes, Exceptions etc. Just custom log messages.

    is there any way to do it?

    Thanks.

    opened by osayilgan 1
  • ACRA

    ACRA

    In the spirit of not reinventing the wheel, why not integrate these backends into an open source (and personally I think a great library) project ACRA within their backends.

    This might (hopefully) force those providers you have in your library and similar to utilize ACRA as the interface to tracking/analytics. Just my .02 cents. Thanks.

    opened by SandNerd 2
Owner
Percolate
Percolate
Small command-line utility to safely merge multiple WhatsApp backups (msgstore.db) into one.

whatsapp-database-merger A small command-line utility that can be used to merge multiple WhatsApp databases (msgstore.db) into one. A few notes: input

Mattia Iavarone 31 Dec 27, 2022
TSBattery a new way to save your battery avoid cancer apps hacker it.

TSBattery TSBattery a new way to save your battery avoid cancer apps hacker it. TSBattery 是一个旨在使 QQ、TIM 变得更省电的开源 Xposed 模块 Get startted 此模块支持原生 Xposed

Fankesyooni 375 Jan 2, 2023
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop

vector-compat A support library for VectorDrawable and AnimatedVectorDrawable introduced in Lollipop with fully backwards compatible tint support (api

Wael N 1.2k Nov 29, 2022
Mi-FreeForm - An APP that is activated through Shizuku/Sui and can display most apps in the form of freeform

Mi-FreeForm 简体中文 Mi-FreeForm is an APP that is activated through Shizuku/Sui and

KindBrive 181 Dec 31, 2022
a SharedPreferences replacement for Android with multiprocess support

DEPRECATED - no longer actively maintained Tray - a SharedPreferences replacement for Android If you have read the documentation of the SharedPreferen

HCI @ gcx 2.3k Nov 17, 2022
Long-term support releases of Birday updated with the latest translations

Note: this document is still a work in progress. Birday LTS This repository is based on the 2.1.0 release of https://github.com/m-i-n-a-r/birday. You

Dominik Novosel 1 May 16, 2022
Predictable state container for JavaScript apps

Redux is a predictable state container for JavaScript apps. (Not to be confused with a WordPress framework – Redux Framework) It helps you write appli

Redux 59.1k Jan 3, 2023
Various useful utilities for Android apps development

Android Commons Various useful utilities for Android apps development. API documentation provided as Javadoc. Usage Add dependency to your build.gradl

Alex Vasilkov 112 Nov 14, 2022
An Android App which is capable of accessing system apps

Android_Project_Kotlin In this Project I am building an Android App which is capable of accessing system apps. This project is written in Kotlin and I

null 0 Dec 13, 2021
KDoctor - A command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development

KDoctor is a command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development.

Kotlin 331 Dec 29, 2022