當前位置: 首頁>>代碼示例>>Java>>正文


Java FirebaseAnalytics.logEvent方法代碼示例

本文整理匯總了Java中com.google.firebase.analytics.FirebaseAnalytics.logEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java FirebaseAnalytics.logEvent方法的具體用法?Java FirebaseAnalytics.logEvent怎麽用?Java FirebaseAnalytics.logEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.firebase.analytics.FirebaseAnalytics的用法示例。


在下文中一共展示了FirebaseAnalytics.logEvent方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: logMenuItemToFirebase

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
void logMenuItemToFirebase(@NonNull MenuItem item) {
  if (firebaseEnabled) {

    final Intent intent = item.getIntent();

    if (intent == null) {
      Log.i(TAG, "logMenuItemToFirebase: Invalid menu item. Intent must be supplied!");
      return;
    }

    final FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);

    final Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, intent.getStringExtra(Kolibri.EXTRA_ID));

    if (intent.hasExtra(Intent.EXTRA_TITLE)) {
      bundle.putString(FirebaseAnalytics.Param.ITEM_NAME,
          intent.getStringExtra(Intent.EXTRA_TITLE));
    }

    bundle
        .putString(FirebaseAnalytics.Param.CONTENT_TYPE, intent.getStringExtra(Kolibri.EXTRA_ID));
    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
  }
}
 
開發者ID:azmedien,項目名稱:kolibri-android,代碼行數:26,代碼來源:KolibriApp.java

示例2: reportToFirebase

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
public void reportToFirebase(@Nullable String name, @NonNull String url) {
  if (firebaseEnabled) {

    final FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);

    final Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, url);

    if (name != null) {
      bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
      bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, name);
    } else {
      bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "application/amp+html");
    }

    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
  }
}
 
開發者ID:azmedien,項目名稱:kolibri-android,代碼行數:19,代碼來源:KolibriApp.java

示例3: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle b) {
    super.onCreate(b);
    status = ActivityStatus.ACTIVE;

    DateFormat format = new SimpleDateFormat("ddMMhhmmss");

    FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    Bundle            bundle             = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, format.format(new Date()));
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, getActivityTag());
    mFirebaseAnalytics.logEvent("ActivityStartEvent", bundle);

    if (Utils.getContext() == null) {
        Utils.getController().setContext(getApplicationContext());
    }
}
 
開發者ID:LCA311,項目名稱:leoapp-sources,代碼行數:18,代碼來源:ActionLogActivity.java

示例4: getAnalytics

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
public void getAnalytics(String id, String name, String type, FirebaseAnalytics firebaseAnalytics){
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, type);
    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
}
 
開發者ID:fiepi,項目名稱:moebooru-android,代碼行數:8,代碼來源:AnalyticsUtils.java

示例5: onClick

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
    switch (v.getId()) {
        case R.id.card_image_to_ascii:
            firebaseAnalytics.logEvent("card_image_to_ascii", new Bundle());
            startActivity(new Intent(this, ImageToAsciiActivity.class));
            break;
        case R.id.card_big_ascii:
            firebaseAnalytics.logEvent("card_big_ascii", new Bundle());
            startActivity(new Intent(this, BigFontActivity.class));
            break;
        case R.id.card_image_ascii:
            firebaseAnalytics.logEvent("card_image_ascii", new Bundle());
            startActivity(new Intent(this, ImageAsciiActivity.class));
            break;
        case R.id.card_emoticons:
            firebaseAnalytics.logEvent("card_emoticons", new Bundle());
            startActivity(new Intent(this, EmoticonsActivity.class));
            break;
        case R.id.card_figlet:
            firebaseAnalytics.logEvent("card_figlet", new Bundle());
            startActivity(new Intent(this, FigletActivity.class));
            break;
        case R.id.card_emoji:
            firebaseAnalytics.logEvent("card_emoji", new Bundle());
            startActivity(new Intent(this, EmojiActivity.class));
            break;
        case R.id.card_symbol:
            firebaseAnalytics.logEvent("card_symbol", new Bundle());
            startActivity(new Intent(this, SymbolActivity.class));
            break;
        case R.id.btn_remove_ads:
            firebaseAnalytics.logEvent("btn_remove_ads", new Bundle());
            StoreUtil.gotoPlayStore(this, "com.duy.asciigenerator.pro");
            break;
    }
}
 
開發者ID:tranleduy2000,項目名稱:ascii_generate,代碼行數:39,代碼來源:MainActivity.java

示例6: firebaseAnalyticsLogEventSelectContent

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
/**
 * Logs a Firebase Analytics select content event.
 * https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#SELECT_CONTENT
 * @param analytics FirebaseAnalytics
 * @param id id
 * @param name name
 * @param type type
 */
public static void firebaseAnalyticsLogEventSelectContent(final FirebaseAnalytics analytics,
                                                          final String id, final String name,
                                                          final String type) {
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, type);
    analytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
}
 
開發者ID:an-garcia,項目名稱:MovieGuide,代碼行數:18,代碼來源:ActivityUtils.java

示例7: firebaseAnalyticsLogEventSearch

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
/**
 * Logs a Firebase Analytics search event.
 * https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#SEARCH
 * @param analytics FirebaseAnalytics
 * @param search string to search
 */
public static void firebaseAnalyticsLogEventSearch(final FirebaseAnalytics analytics,
                                                   final String search) {
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.SEARCH_TERM, search);
    analytics.logEvent(FirebaseAnalytics.Event.SEARCH, bundle);
}
 
開發者ID:an-garcia,項目名稱:MovieGuide,代碼行數:13,代碼來源:ActivityUtils.java

示例8: firebaseAnalyticsLogEventViewSearchResults

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
/**
 * Logs a Firebase Analytics view search results event.
 * https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#VIEW_SEARCH_RESULTS
 * @param analytics FirebaseAnalytics
 * @param search string to search
 */
public static void firebaseAnalyticsLogEventViewSearchResults(final FirebaseAnalytics analytics,
                                                              final String search) {
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.SEARCH_TERM, search);
    analytics.logEvent(FirebaseAnalytics.Event.VIEW_SEARCH_RESULTS, bundle);
}
 
開發者ID:an-garcia,項目名稱:MovieGuide,代碼行數:13,代碼來源:ActivityUtils.java

示例9: firebaseAnalyticsLogEventViewItem

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
/**
 * Logs a Firebase Analytics view item event.
 * https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#VIEW_ITEM
 * @param analytics FirebaseAnalytics
 * @param id id
 * @param name name
 * @param category category
 */
public static void firebaseAnalyticsLogEventViewItem(final FirebaseAnalytics analytics,
                                                     final String id, final String name,
                                                     final String category) {
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
    bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, category);
    analytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
}
 
開發者ID:an-garcia,項目名稱:MovieGuide,代碼行數:18,代碼來源:ActivityUtils.java

示例10: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_product);
    ButterKnife.bind(this);
    session = new SessionManager(this);
    FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "1");
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "oke");
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);

    if (isTablet && savedInstanceState == null) {
        if(session.getLastpage().equals("setting")){
            loadSettingFragment();
            System.out.println(session.getLastpage());
        }

        else {

            loadDetailFragmentWith("null", "null");
        }
    }


}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:28,代碼來源:ProductActivity.java

示例11: trackBuy

import com.google.firebase.analytics.FirebaseAnalytics; //導入方法依賴的package包/類
void trackBuy(String crypto, String base) {
    FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(context);

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, preferences.getCryptoCurrency());
    bundle.putString(FirebaseAnalytics.Param.VALUE, crypto);

    Bundle bundle2 = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, preferences.getBaseCurrency());
    bundle.putString(FirebaseAnalytics.Param.VALUE, base);

    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SPEND_VIRTUAL_CURRENCY, bundle);
    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SPEND_VIRTUAL_CURRENCY, bundle2);
}
 
開發者ID:aomega08,項目名稱:Keep-HODLing,代碼行數:15,代碼來源:BuyEvent.java


注:本文中的com.google.firebase.analytics.FirebaseAnalytics.logEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。