• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EventBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.android.gms.analytics.HitBuilders.EventBuilder的典型用法代码示例。如果您正苦于以下问题:Java EventBuilder类的具体用法?Java EventBuilder怎么用?Java EventBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventBuilder类属于com.google.android.gms.analytics.HitBuilders包,在下文中一共展示了EventBuilder类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sendEvent

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void sendEvent(String category, String action, String label,
		Long value) {
	try {
		EventBuilder builder = new HitBuilders.EventBuilder(category, action);
		if (label != null) {
			builder.setLabel(label);
		}
		if (value != null) {
			builder.setValue(value);
		}
		mTracker.send(builder.build());
	} catch (Throwable t) {
		if (AndroidUtils.DEBUG) {
			Log.e(TAG, "sendEvent", t);
		}
	}
}
 
开发者ID:vuze,项目名称:vuze-remote-for-android,代码行数:19,代码来源:VuzeEasyTrackerNew.java


示例2: onClick

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void onClick(final View v) {

    switch (v.getId()) {

        case R.id.button_reset_password: {
            if (isInputValid()) {
                GoogleAnalyticsManager
                        .getInstance()
                        .sendEvent(
                                new EventBuilder(Categories.CONVERSION, Actions.SIGN_IN_ATTEMPT)
                                        .set(ParamKeys.TYPE, ParamValues.RESET)
                        );
                callPasswordReset(mTokenEditText.getText().toString(),
                                  mNewPasswordEditText.getText().toString(), mEmailId);
            }
            break;
        }


    }
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:23,代码来源:PasswordResetFragment.java


示例3: sendEvent

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
/**
 * Send a specific event.
 *
 * @param category The event category.
 * @param action   The action.
 * @param label    The label.
 * @param value    An associated value.
 */
public static void sendEvent(final Category category, final String action, final String label, final Long value) {
	getDefaultTracker();
	EventBuilder eventBuilder = new EventBuilder();
	eventBuilder.setCategory(category.toString());
	if (action != null) {
		eventBuilder.setAction(action);
	}
	if (label == null) {
		eventBuilder.setLabel(action);
	}
	else {
		eventBuilder.setLabel(action + " - " + label);
	}
	if (value != null) {
		eventBuilder.setValue(value);
	}
	mTracker.send(eventBuilder.build());
}
 
开发者ID:jeisfeld,项目名称:Augendiagnose,代码行数:27,代码来源:TrackingUtil.java


示例4: sendHitNewGame

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
public static void sendHitNewGame()
{
    if (Statistics.tracker != null)
    {
        Thread threadGameMode = new Thread(new Runnable()
        {
            @Override
            public void run()
            {
                EventBuilder builder = new HitBuilders.EventBuilder();
                builder.setCategory(Statistics.CATEGORY_GAME);
                builder.setAction(Statistics.EVENT_NEW_GAME);

                Statistics.tracker.send(builder.build());
            }
        });
        threadGameMode.start();
    }
}
 
开发者ID:mauriciotogneri,项目名称:tensiontunnel,代码行数:20,代码来源:Statistics.java


示例5: sendHitCollision

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
public static void sendHitCollision(final CollisionType collisionType)
{
    if (Statistics.tracker != null)
    {
        Thread threadGameMode = new Thread(new Runnable()
        {
            @Override
            public void run()
            {
                EventBuilder builder = new HitBuilders.EventBuilder();
                builder.setCategory(Statistics.CATEGORY_COLLISION);
                builder.setAction(collisionType.toString());

                Statistics.tracker.send(builder.build());
            }
        });
        threadGameMode.start();
    }
}
 
开发者ID:mauriciotogneri,项目名称:tensiontunnel,代码行数:20,代码来源:Statistics.java


示例6: sendAppLaunched

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
public synchronized void sendAppLaunched()
{
    threadPool.submit(new Runnable()
    {
        @Override
        public void run()
        {
            tracker.setScreenName("App Launched");
            tracker.send(new HitBuilders.ScreenViewBuilder().build());
        }
    });

    threadPool.submit(new Runnable()
    {
        @Override
        public void run()
        {
            Date date = new Date();
            Calendar calendar = GregorianCalendar.getInstance();
            calendar.setTime(date);
            int hour = calendar.get(Calendar.HOUR_OF_DAY);

            EventBuilder eventBuilder = new HitBuilders.EventBuilder();
            eventBuilder.setCategory("TIME_APP_OPEN");
            eventBuilder.setAction(String.valueOf(hour));
            tracker.send(eventBuilder.build());
        }
    });
}
 
开发者ID:mauriciotogneri,项目名称:shoppinglist,代码行数:30,代码来源:Stats.java


示例7: addedCartItem

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
public synchronized void addedCartItem(final CartItem cartItem)
{
    threadPool.submit(new Runnable()
    {
        @Override
        public void run()
        {
            EventBuilder eventBuilder = new HitBuilders.EventBuilder();
            eventBuilder.setCategory("ADDED_PRODUCT_TO_CART");
            eventBuilder.setAction(cartItem.getCategory().getName());
            tracker.send(eventBuilder.build());
        }
    });
}
 
开发者ID:mauriciotogneri,项目名称:shoppinglist,代码行数:15,代码来源:Stats.java


示例8: sendEvent

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
/**
 * Track event.
 * 
 * @param context
 * @param category of event, see CAT_XX constants
 * @param action action of event
 * @param label of event
 * @param value of event
 */
public static void sendEvent(Context context, String category, String action, String label, Long value) {
  if (!GHConstants.DEBUG) {
    Tracker t = getTracker(context);
    if (t != null) {
      EventBuilder eb = new HitBuilders.EventBuilder();
      eb.setCategory(category).setAction(action).setLabel(label);
      if (value != null) {
        eb.setValue(value);
      }
      t.send(eb.build());
    }
  }
}
 
开发者ID:Daskiworks,项目名称:ghwatch,代码行数:23,代码来源:ActivityTracker.java


示例9: onReceive

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    if (mSlidingLayout.isExpanded()) {
        GoogleAnalyticsManager
                .getInstance()
                .sendEvent(new EventBuilder(Categories.USAGE, Actions.CHAT_INITIALIZATION)
                        .set(ParamKeys.TYPE, ParamValues.PROFILE));
    } else {
        GoogleAnalyticsManager
                .getInstance()
                .sendEvent(new EventBuilder(Categories.USAGE, Actions.CHAT_INITIALIZATION)
                        .set(ParamKeys.TYPE, ParamValues.BOOK));
    }
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:15,代码来源:BooksPagerFragment.java


示例10: onDialogClick

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void onDialogClick(final DialogInterface dialog, final int which) {

    if ((mAddBookDialogFragment != null)
            && mAddBookDialogFragment.getDialog().equals(dialog)) {

        if (which == 0) { // scan book
            startActivityForResult(new Intent(getActivity(), ScanIsbnActivity.class),
                    RequestCodes.SCAN_ISBN);
            GoogleAnalyticsManager
                    .getInstance()
                    .sendEvent(new EventBuilder(Categories.USAGE, Actions.ADD_BOOK)
                            .set(ParamKeys.TYPE, ParamValues.SCAN));

        } else if (which == 1) { // add book manually
            loadAddOrEditBookFragment(null);
            GoogleAnalyticsManager
                    .getInstance()
                    .sendEvent(new EventBuilder(Categories.USAGE, Actions.ADD_BOOK)
                            .set(ParamKeys.TYPE, ParamValues.MANUAL));
        }
    } else if ((mEnableLocationDialogFragment != null)
            && mEnableLocationDialogFragment.getDialog()
            .equals(dialog)) {

        if (which == DialogInterface.BUTTON_POSITIVE) { // enable location
            Intent locationOptionsIntent = new Intent(
                    android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
            startActivity(locationOptionsIntent);

        } else if (which == DialogInterface.BUTTON_NEGATIVE) { // cancel
            dialog.cancel();
        }
    } else {
        super.onDialogClick(dialog, which);
    }
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:38,代码来源:BooksAroundMeFragment.java


示例11: onItemClick

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void onItemClick(final AdapterView<?> parent, final View view,
                        final int position, final long id) {

    if (parent.getId() == R.id.grid_profile_books) {

        if (!mUserId.equals(UserInfo.INSTANCE.getId())) {
            GoogleAnalyticsManager.getInstance().sendEvent(
                    new EventBuilder(Categories.USAGE, Actions.BOOK_PROFILE_CLICK));
        }
        final Cursor cursor = (Cursor) mProfileBooksAdapter
                .getItem(position);

        final String bookId = cursor.getString(cursor.getColumnIndex(DatabaseColumns.ID));

        final Intent bookDetailIntent = new Intent(getActivity(), BookDetailActivity.class);
        bookDetailIntent.putExtra(Keys.ID, bookId);
        startActivity(bookDetailIntent);

        /*final Bundle showBooksArgs = Utils.cursorToBundle(cursor);

        loadFragment(R.id.frame_content, (AbstractBarterLiFragment) Fragment
                             .instantiate(getActivity(), BookDetailFragment.class
                                     .getName(), showBooksArgs),
                     FragmentTags.USER_BOOK_FROM_PROFILE, true,
                     FragmentTags.BS_EDIT_PROFILE
        );*/
    }
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:30,代码来源:MyBooksFragment.java


示例12: sendEvent

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
/**
 * Inform an event to Google Analytics
 *
 * @param builder
 */
public void sendEvent(EventBuilder builder) {

    builder.set(ParamKeys.LOGGED_IN, TextUtils.isEmpty(UserInfo.INSTANCE
            .getId()) ? ParamValues.NO : ParamValues.YES);
    mApplicationTracker.send(builder.build());
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:12,代码来源:GoogleAnalyticsManager.java


示例13: analytics_sendEvent

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
/**
 * Sends to Google Analytics an event.
 * 
 * @param tracker		The analytics tracker to use when sending the 
 * 						event.
 * @param eventCategory	Category of the event
 * @param eventAction	Action of the event
 * @param eventlabel	label of the event
 */
public static void analytics_sendEvent (Tracker tracker, String eventCategory, String eventAction, String eventlabel, Long eventValue) {
	
	EventBuilder eBuilder = new HitBuilders.EventBuilder();
	eBuilder.setCategory(eventCategory)
			.setAction(eventAction)
			.setLabel(eventlabel);
	
	if(eventValue!=null) {
		eBuilder.setValue(eventValue);			
	}
	
	tracker.send(eBuilder.build());
}
 
开发者ID:javocsoft,项目名称:javocsoft-toolbox,代码行数:23,代码来源:ToolBox.java


示例14: onClick

import com.google.android.gms.analytics.HitBuilders.EventBuilder; //导入依赖的package包/类
@Override
public void onClick(final View v) {

    switch (v.getId()) {

        case R.id.button_facebook_login: {
            GoogleAnalyticsManager
                    .getInstance()
                    .sendEvent(new EventBuilder(Categories.CONVERSION, Actions.SIGN_IN_ATTEMPT)
                                       .set(ParamKeys.TYPE, ParamValues.FACEBOOK));
            final Session session = Session.getActiveSession();
            if (!session.isOpened() && !session.isClosed()) {
                session.openForRead(new Session.OpenRequest(this)
                                            .setPermissions(Arrays
                                                                    .asList(AppConstants
                                                                                    .FBPERMISSIONS))
                                            .setCallback(this));
            } else {
                Session.openActiveSession(getActivity(), this, true, this);
            }
            break;
        }

        case R.id.button_google_login: {
            GoogleAnalyticsManager
                    .getInstance()
                    .sendEvent(new EventBuilder(Categories.CONVERSION, Actions.SIGN_IN_ATTEMPT)
                                       .set(ParamKeys.TYPE, ParamValues.GOOGLE));
            ((AuthActivity) getActivity()).getPlusManager().login();
            break;
        }

        case R.id.button_submit: {
            if (isInputValid()) {
                GoogleAnalyticsManager
                        .getInstance()
                        .sendEvent(
                                new EventBuilder(Categories.CONVERSION, Actions.SIGN_IN_ATTEMPT)
                                        .set(ParamKeys.TYPE, ParamValues.EMAIL)
                        );
                login(mEmailEditText.getText().toString(), mPasswordEditText
                        .getText().toString());
            }
            break;
        }

        case R.id.forgot_password: {
            showForgotPasswordDialog();

        }
    }
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:53,代码来源:LoginFragment.java



注:本文中的com.google.android.gms.analytics.HitBuilders.EventBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ModifiedExpiryPolicy类代码示例发布时间:2022-05-23
下一篇:
Java OnLoadCompleteListener类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap