Skip to content

Instantly share code, notes, and snippets.

@DzikuVx
Created September 29, 2014 16:58
Show Gist options
  • Save DzikuVx/7a35738d7ef5ced9fd0b to your computer and use it in GitHub Desktop.
Save DzikuVx/7a35738d7ef5ced9fd0b to your computer and use it in GitHub Desktop.
package pl.spychalski.WeatherStation;
import android.app.Application;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
public class PogodaApplication extends Application {
private Tracker appTracker = null;
private static final String TRACKING_ID = "UA-xxxxxxx-xx";
synchronized Tracker getTracker() {
if (appTracker == null) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
appTracker = analytics.newTracker(TRACKING_ID);
}
return appTracker;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment