コード例 #1
0
  @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;
  }
コード例 #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("ゲド電気");
    }
  }
コード例 #3
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();
    // }
  }
コード例 #4
0
ファイル: AnalyticsUtils.java プロジェクト: bfly75/mytracks
 /**
  * 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);
 }
コード例 #5
0
 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);
   }
 }
コード例 #6
0
  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();
    }
  }
コード例 #7
0
 public void trackPage(String page) {
   if ((m_tracker != null) && m_bActive) {
     m_tracker.trackPageView(page);
   }
 }
コード例 #8
0
ファイル: Friends.java プロジェクト: ramsay/PushPoll-Public
 @Override
 protected void onResume() {
   super.onResume();
   tracker.trackPageView("/friends");
 }
コード例 #9
0
ファイル: AnalyticsTracker.java プロジェクト: janls/worktime
 public void trackPageView(String pageView) {
   if (!ContextUtils.isStableBuild(ctx)) {
     return;
   }
   gat.trackPageView(pageView);
 }