Android Open Source - piwik-sdk-android Piwik Application






From Project

Back to project page piwik-sdk-android.

License

The source code is released under:

Copyright 2014 Piwik team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redi...

If you think the Android project piwik-sdk-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Android SDK for Piwik/*from w  w w.  j a  v  a 2  s  .  co m*/
 *
 * @link https://github.com/piwik/piwik-android-sdk
 * @license https://github.com/piwik/piwik-sdk-android/blob/master/LICENSE BSD-3 Clause
 */

package org.piwik.sdk;

import android.app.Application;
import android.util.Log;

import java.net.MalformedURLException;

public abstract class PiwikApplication extends Application {
    Tracker piwikTracker;

    public Piwik getGlobalSettings(){
        return Piwik.getInstance(this);
    }

    public Tracker getTracker() {
        if (piwikTracker != null) {
            return piwikTracker;
        }

        try {
            piwikTracker = getGlobalSettings().newTracker(getTrackerUrl(), getSiteId(), getAuthToken());
        } catch (MalformedURLException e) {
            Log.i(Tracker.LOGGER_TAG, getTrackerUrl());
            Log.w(Tracker.LOGGER_TAG, "url is malformed", e);
            return null;
        }

        return piwikTracker;

    }

    public String getTrackerUrl() {
        return "";
    }

    public String getAuthToken() {
        return "";
    }

    public Integer getSiteId() {
        return 1;
    }

}




Java Source Code List

com.piwik.demo.ApplicationTest.java
com.piwik.demo.DemoActivity.java
com.piwik.demo.DemoApp.java
com.piwik.demo.SettingsActivity.java
org.piwik.sdk.CustomVariables.java
org.piwik.sdk.Dispatchable.java
org.piwik.sdk.DispatchingHandler.java
org.piwik.sdk.PiwikApplication.java
org.piwik.sdk.Piwik.java
org.piwik.sdk.TrackerBulkURLProcessor.java
org.piwik.sdk.TrackerBulkURLWrapper.java
org.piwik.sdk.Tracker.java