예제 #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    overridePendingTransition(R.anim.fadein, R.anim.fadeout);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
    setContentView(R.layout.main);
    View LLView = findViewById(R.id.LLMainPage);
    View root = LLView.getRootView();
    root.setBackgroundColor(Color.WHITE);

    Start = (Button) findViewById(R.id.btnStartPractice);
    // Version =(TextView)findViewById(R.id.txtMainpgVersion);
    Start.setOnClickListener(this);

    ConfigureVersion();
    tracker = GoogleAnalyticsTracker.getInstance();
    // Start the tracker in manual dispatch mode...
    tracker.startNewSession("UA-32911832-1", this);

    tracker.trackPageView("/ApplicationStart");
    tracker.dispatch();

    // testing the cache HERE
    // LocalCache cache = ((LocalCache)getApplicationContext());

    // List<QuestionLookupItem> items = cache.getQuestionsIds();

    // if(items != null){

    // Toast.makeText(getBaseContext(),
    //        "Your query returned " + String.valueOf(items.size()) + " records.",
    //        Toast.LENGTH_LONG).show();
    // }
  }
예제 #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main2);

    int num = getIntent().getExtras().getInt("num");

    TextView tv = (TextView) findViewById(R.id.textView);

    tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start("UA-24434459-1", 5, this);

    // セッション
    //        tracker.setCustomVar(2, "SecondActivity", "During Visit",3);
    // ページビュー
    tracker.trackPageView("/SecondAcivity");

    if (num == 1) {
      tv.setText("海が荒ぶる");
    } else if (num == 2) {
      tv.setText("魔法少女の特急便");
    } else {
      tv.setText("ゲド電気");
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GoogleAnalyticsTracker.getInstance()
        .trackPageView(GoogleAnalyticsUtil.generatePageName(LOG_TAG));
    setContentView(R.layout.trucoannotator);

    // Setteo las acciones para los elementos del equipo "nosotros"
    List<Integer> viewsToDisable = new ArrayList<Integer>();
    viewsToDisable.add(R.id.trucoAnnotator_labelTeam2);
    viewsToDisable.add(R.id.trucoAnnotator_scoreTeam2);
    viewsToDisable.add(R.id.trucoAnnotator_substractButtonTeam2);
    setActions(
        R.id.trucoAnnotator_scoreTeam1,
        R.string.trucoAnnotator_youWin,
        R.id.trucoAnnotator_labelTeam1,
        viewsToDisable);

    // Setteo las acciones para los elementos del equipo "ellos"
    viewsToDisable.clear();
    viewsToDisable.add(R.id.trucoAnnotator_labelTeam1);
    viewsToDisable.add(R.id.trucoAnnotator_scoreTeam1);
    viewsToDisable.add(R.id.trucoAnnotator_substractButtonTeam1);
    setActions(
        R.id.trucoAnnotator_scoreTeam2,
        R.string.trucoAnnotator_theyWin,
        R.id.trucoAnnotator_labelTeam2,
        viewsToDisable);
  }
예제 #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mUri = getIntent().getData();
    setContentView(R.layout.notifying_controller);

    Button button = (Button) findViewById(R.id.notifyStart);
    button.setOnClickListener(mStartListener);
    button = (Button) findViewById(R.id.notifyStop);
    button.setVisibility(Button.INVISIBLE);
    button.setOnClickListener(mStopListener);

    tracker = GoogleAnalyticsTracker.getInstance();

    // Start the tracker in manual dispatch mode...
    tracker.start(NonPublicConstants.NONPUBLIC_GOOGLE_ANALYTICS_UA_ACCOUNT_CODE, 20, this);
    SharedPreferences prefs =
        getSharedPreferences(PreferenceConstants.PREFERENCE_NAME, MODE_PRIVATE);
    mAuBlogInstallId = prefs.getString(PreferenceConstants.AUBLOG_INSTALL_ID, "0");

    tracker.trackEvent(
        mAuBlogInstallId, // Category
        "Notifications", // Action
        "User found the notification controller by clicking on the recording notification. "
            + System.currentTimeMillis()
            + " : "
            + mAuBlogInstallId, // Label
        (int) System.currentTimeMillis()); // Value
  }
예제 #5
0
 /**
  * Sends a page view.
  *
  * @param context the context
  * @param page the page
  */
 public static void sendPageViews(Context context, String page) {
   if (tracker == null) {
     tracker = GoogleAnalyticsTracker.getInstance();
     tracker.startNewSession(UA, context);
     tracker.setProductVersion(PRODUCT_NAME, SystemUtils.getMyTracksVersion(context));
   }
   tracker.trackPageView(page);
 }
예제 #6
0
 // begin the tracker for an activity - should be called only once per activity instance
 public static GoogleAnalyticsTracker start(Activity activity) {
   if (analyticsEnabled(activity)) {
     Log.i(Utils.TAG, "[Analytics] Tracker starting");
     GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
     String code = activity.getResources().getString(R.string.google_analytics_tracking_code);
     tracker.startNewSession(code, activity);
     return tracker;
   } else return null;
 }
예제 #7
0
  public static AnalyticsTracker getInstance(Context ctx) {
    AnalyticsTracker tracker = new AnalyticsTracker();
    tracker.ctx = ctx;

    if (!ContextUtils.isStableBuild(ctx)) {
      return tracker;
    }

    tracker.gat = GoogleAnalyticsTracker.getInstance();
    tracker.gat.startNewSession(ACCOUNT_UA, DISPATCH_INTERVAL_SEC, ctx);

    return tracker;
  }
예제 #8
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // init
    activity = this;
    res = this.getResources();
    app = (cgeoapplication) this.getApplication();
    settings = new cgSettings(this, getSharedPreferences(cgSettings.preferences, 0));
    base = new cgBase(app, settings, getSharedPreferences(cgSettings.preferences, 0));
    warning = new cgWarning(this);

    // set layout
    if (settings.skin == 1) {
      setTheme(R.style.light);
    } else {
      setTheme(R.style.dark);
    }
    setContentView(R.layout.waypoint);
    base.setTitle(activity, "waypoint");

    // google analytics
    tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start(cgSettings.analytics, this);
    tracker.dispatch();
    base.sendAnal(activity, tracker, "/waypoint/detail");

    // get parameters
    Bundle extras = getIntent().getExtras();

    // try to get data from extras
    if (extras != null) {
      id = extras.getInt("waypoint");
      geocode = extras.getString("geocode");
    }

    if (id <= 0) {
      warning.showToast(res.getString(R.string.err_waypoint_unknown));
      finish();
      return;
    }

    if (geo == null) {
      geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
    }

    waitDialog = ProgressDialog.show(this, null, res.getString(R.string.waypoint_loading), true);
    waitDialog.setCancelable(true);

    (new loadWaypoint()).start();
  }
  public static GoogleAnalytics getInstance(Context context) {
    SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
    m_bActive = sharedPrefs.getBoolean("use_analytics", true);

    if (m_singleton == null) {
      m_singleton = new GoogleAnalytics();
      if (m_bActive) {
        m_tracker = GoogleAnalyticsTracker.getInstance();

        // Start the tracker in manual dispatch mode...
        m_tracker.startNewSession("TRACKING_CODE_HERE", 20, context);
      }
    }
    return m_singleton;
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mContext = this;

    /** GA * */
    tracker = GoogleAnalyticsTracker.getInstance();
    tracker.startNewSession("UA-34492615-1", 10, this);

    View banner = (View) this.findViewById(R.id.relaBanner);
    AdView adView = (AdView) banner.findViewById(R.id.adView);
    adView.loadAd(new AdRequest());

    layout = (LinearLayout) findViewById(R.id.linearContent);

    // Make my account as default
    vContent = new MyAccountView(this, mApi);
    ((MyAccountView) vContent).setOnItemSelectionListener(this);
    layout.addView(vContent);
  }
예제 #11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (getSupportFragmentManager().findFragmentById(android.R.id.content) != null) {
      FragmentManager fragMgr = getSupportFragmentManager();
      FragmentTransaction ft = fragMgr.beginTransaction();
      ft.detach(getSupportFragmentManager().findFragmentById(android.R.id.content));
      ft.commit();
    }

    tracker = GoogleAnalyticsTracker.getInstance();

    // Start the tracker in manual dispatch mode...
    tracker.startNewSession(Keys.ANALYTICS_KEY, this);
    // setup action bar for tabs
    ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    Tab friendsTab =
        actionBar
            .newTab()
            .setText(R.string.friends_tabtitle)
            .setTabListener(
                new TabListenerList<FriendListFragment>(this, "friends", FriendListFragment.class));
    actionBar.addTab(friendsTab, true);

    Tab groupsTab =
        actionBar
            .newTab()
            .setText(R.string.groups_tabtitle)
            .setTabListener(
                new TabListenerList<GroupListFragment>(this, "groups", GroupListFragment.class));
    actionBar.addTab(groupsTab, true);

    actionBar.setSelectedNavigationItem(0);
  }