当前位置: 首页>>代码示例>>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;未经允许,请勿转载。