@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
  }
  @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
  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();
    // }
  }
Beispiel #4
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);
 }
 // 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;
 }
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.exit) {
      // close the Activity
      this.finish();
      return true;
    } else if (item.getItemId() == R.id.facebook) {
      facebook.authorize(
          this,
          new String[] {
            "user_checkins",
            "friends_checkins",
            "publish_checkins",
            "email",
            "publish_stream",
            "read_stream",
            "offline_access"
          },
          new DialogListener() {
            @Override
            public void onComplete(Bundle values) {
              Log.i("accesstoken =", "" + facebook.getAccessToken());
            }

            @Override
            public void onFacebookError(FacebookError error) {}

            @Override
            public void onError(DialogError e) {}

            @Override
            public void onCancel() {}
          });
      return true;
    } else if (item.getItemId() == R.id.note) {
      tracker.trackPageView("/Notes");

      Intent intent = new Intent(MainActivity.this, NotesList.class);
      startActivity(intent);
      return true;
    } else if (item.getItemId() == R.id.photo) {
      tracker.trackPageView("/Photos");

      Intent intent = new Intent(MainActivity.this, PhotoActivity.class);
      startActivity(intent);
      return true;
    } else if (item.getItemId() == R.id.voice) {
      tracker.trackPageView("/Voices");
      Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
      startActivityForResult(intent, RQS_RECORDING);
    }
    return false;
  }
 public static GoogleAnalyticsTracker attachCustomVars(
     Activity activity, GoogleAnalyticsTracker tracker) {
   Resources res = activity.getResources();
   String appVersion = res.getString(R.string.app_version);
   tracker.setCustomVar(CUSTOM_VERSION_SLOT, CUSTOM_VERSION_NAME, appVersion, SCOPE_PAGE);
   String originalChannel = Utils.getStringPreference(activity, ORIGINAL_CHANNEL_PREFERENCE);
   tracker.setCustomVar(
       CUSTOM_ORIGINAL_CHANNEL, CUSTOM_ORIGINAL_CHANNEL_NAME, originalChannel, SCOPE_PAGE);
   String marketChannel = res.getString(R.string.market_channel);
   tracker.setCustomVar(
       CUSTOM_MARKET_CHANNEL, CUSTOM_MARKET_CHANNEL_NAME, marketChannel, SCOPE_PAGE);
   return tracker;
 }
  @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;
  }
  @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);
  }
Beispiel #11
0
  @Override
  public void onDestroy() {
    if (geo != null) geo = app.removeGeo();
    if (tracker != null) tracker.stop();

    super.onDestroy();
  }
 public void trackStats(Context context, String page, int stat, int statType, int sort) {
   if ((m_tracker != null) && m_bActive) {
     m_tracker.trackPageView(
         page
             + StatsProvider.getInstance(context).statToUrl(stat)
             + StatsProvider.getInstance(context).statTypeToUrl(statType)
             + "Sort"
             + sort);
   }
 }
  /** 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);
  }
 public void onClick(View v) {
   Intent intent = new Intent(NotifyingController.this, DictationRecorderService.class);
   stopService(intent);
   tracker.trackEvent(
       mAuBlogInstallId, // Category
       "Dictation stopped", // Action
       "User clicked Stop Dictation  in Notifying controller : "
           + System.currentTimeMillis()
           + " : "
           + mAuBlogInstallId, // Label
       (int) System.currentTimeMillis()); // Value
 }
Beispiel #15
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);
  }
Beispiel #16
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;
  }
 public static void event(
     Activity activity,
     GoogleAnalyticsTracker tracker,
     String category,
     String action,
     String label) {
   if (tracker != null && analyticsEnabled(activity)) {
     tracker = attachCustomVars(activity, tracker);
     Log.i(
         Utils.TAG,
         "[Analytics] Tracking event - category: "
             + category
             + ", action: "
             + action
             + ", label: "
             + label);
     // tracker.setDebug(true);
     tracker.setAnonymizeIp(true);
     tracker.trackEvent(category, action, label, -1);
     tracker.dispatch();
   }
 }
 @Override
 protected void onDestroy() {
   String release = Build.VERSION.RELEASE;
   tracker.stop();
   super.onDestroy();
   /*
   if(release.equals("2.2")){
      	//this does not show a force close, but does sucessfully allow the user to disconnect the bluetooth after they close aublog.
      	//if they have android 2.2 and they disconnect the bluetooth without quitting aublog then the device will reboot.
      	 android.os.Process.killProcess(android.os.Process.myPid());
      }else{
      	//do nothing, bluetooth issue is fixed in 2.2.1 and above
      }*/
 }
  public static void page(
      Activity activity, GoogleAnalyticsTracker tracker, String page, boolean checkEntry) {
    if (tracker != null && analyticsEnabled(activity)) {

      if (checkEntry) {
        String source = entrySource(activity);
        if (source != null) {
          Log.i(
              Utils.TAG,
              "[Analytics] Marking next page view as an entry to the app of type: " + source);

          markEntry(activity, tracker, source);
        }
      }

      tracker = attachCustomVars(activity, tracker);

      Log.i(Utils.TAG, "[Analytics] Tracking page - " + page);
      // tracker.setDebug(true);
      tracker.setAnonymizeIp(true);
      tracker.trackPageView(page);
      tracker.dispatch();
    }
  }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   // Stop the tracker when it is no longer needed.
   tracker.stopSession();
 }
 public void trackPage(String page) {
   if ((m_tracker != null) && m_bActive) {
     m_tracker.trackPageView(page);
   }
 }
Beispiel #22
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   // これ以上必要のない追跡を停止する
   tracker.stop();
 }
Beispiel #23
0
  @Override
  protected void onPause() {
    super.onPause();

    tracker.dispatch();
  }
Beispiel #24
0
 @Override
 public void onStop() {
   tracker.dispatch();
   super.onStop();
 }
Beispiel #25
0
 public static void dispatch() {
   if (tracker != null) {
     tracker.dispatch();
   }
 }
Beispiel #26
0
 @Override
 protected void onResume() {
   super.onResume();
   tracker.trackPageView("/friends");
 }
 public static void stop(GoogleAnalyticsTracker tracker) {
   if (tracker != null) {
     Log.i(Utils.TAG, "[Analytics] Tracker stopping");
     tracker.stopSession();
   }
 }
Beispiel #28
0
 @Override
 public void onDestroy() {
   tracker.stopSession();
   super.onDestroy();
 }
Beispiel #29
0
 public void stopSession() {
   if (!ContextUtils.isStableBuild(ctx)) {
     return;
   }
   gat.stopSession();
 }
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   tracker.stopSession();
 }