本文整理汇总了Java中com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ScreenViewBuilder类的具体用法?Java ScreenViewBuilder怎么用?Java ScreenViewBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScreenViewBuilder类属于com.google.android.gms.analytics.HitBuilders包,在下文中一共展示了ScreenViewBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activityStart
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
public void activityStart(Activity activity) {
try {
mTracker.setScreenName(activity.getClass().getSimpleName());
ScreenViewBuilder builder = new ScreenViewBuilder();
builder.set(SCREEN_NAME, activity.getClass().getSimpleName());
Intent intent = activity.getIntent();
if (intent != null) {
Uri data = intent.getData();
if (data != null) {
builder.setAll(getReferrerMapFromUri(data));
}
}
mTracker.send(builder.build());
} catch (Throwable t) {
if (AndroidUtils.DEBUG) {
Log.e(TAG, "activityStart", t);
}
}
}
示例2: fragmentStart
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
public void fragmentStart(@Nullable Fragment fragment, String name) {
try {
mTracker.setScreenName(name);
ScreenViewBuilder builder = new ScreenViewBuilder();
builder.set(SCREEN_NAME, name);
mTracker.send(builder.build());
} catch (Throwable t) {
if (AndroidUtils.DEBUG) {
Log.e(TAG, "fragmentStart", t);
}
}
}
示例3: sendScreenHit
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
/**
* Inform a screen hit to Google Analytics
*
* @param screenName A name for the screen
*/
public void sendScreenHit(String screenName) {
mApplicationTracker.setScreenName(screenName);
final ScreenViewBuilder screenViewBuilder = new ScreenViewBuilder();
screenViewBuilder.set(ParamKeys.LOGGED_IN, TextUtils
.isEmpty(UserInfo.INSTANCE.getId()) ? ParamValues.NO
: ParamValues.YES);
mApplicationTracker.send(screenViewBuilder.build());
}
示例4: sendView
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
public static void sendView(final String pScreenName) {
AnalyticsHelper.sTracker.setScreenName(pScreenName);
AnalyticsHelper.sTracker.send(new ScreenViewBuilder().build());
AnalyticsHelper.sTracker.setScreenName(null);
}
示例5: sendScreen
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
/**
* Send a screen opening event.
*
* @param object The activity or fragment showing the screen.
*/
public static void sendScreen(final Object object) {
getDefaultTracker();
mTracker.setScreenName(object.getClass().getSimpleName());
mTracker.send(new ScreenViewBuilder().build());
}
示例6: startSession
import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder; //导入依赖的package包/类
/**
* Start a new session.
*/
public static void startSession() {
mTracker.send(new ScreenViewBuilder().setNewSession().build());
}