本文整理汇总了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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
}
}
示例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);
}