本文整理汇总了Java中com.google.analytics.tracking.android.Fields类的典型用法代码示例。如果您正苦于以下问题:Java Fields类的具体用法?Java Fields怎么用?Java Fields使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Fields类属于com.google.analytics.tracking.android包,在下文中一共展示了Fields类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trackView
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
private void trackView(String screenname, CallbackContext callbackContext) {
if (! trackerStarted ) {
callbackContext.error("Tracker not started");
return;
}
Tracker tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).getDefaultTracker();
addCustomDimensionsToTracker(tracker);
if (null != screenname && screenname.length() > 0) {
tracker.set(Fields.SCREEN_NAME, screenname);
tracker.send(MapBuilder
.createAppView()
.build()
);
callbackContext.success("Track Screen: " + screenname);
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
示例2: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipes list");
tracker.send(MapBuilder.createAppView().build());
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(RecipesManager.ACTION_FINISH_LOADING_RECIPES);
intentFilter.addAction(RecipesManager.ACTION_START_LOADING_RECIPES);
if (RecipesApplication.isLoadingRecipes) {
getActivity().setProgressBarIndeterminateVisibility(true);
} else {
getActivity().setProgressBarIndeterminateVisibility(false);
}
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(broadcastReceiver,
intentFilter);
}
示例3: onCreate
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_menu);
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
findViewById(R.id.pack1_button).setOnClickListener(this);
findViewById(R.id.pack2_button).setOnClickListener(this);
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
tracker.send(MapBuilder.createAppView().set(Fields.SCREEN_NAME, "Home Screen").build());
BugSenseHandler.initAndStartSession(MainMenu.this, "718d6664");
}
示例4: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
protected void onStart() {
super.onStart();
if (mTracker != null) {
mTracker.send(MapBuilder.createAppView().set(Fields.SCREEN_NAME, "auth").build());
mTracker.activityStart(this);
}
}
示例5: onResume
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onResume() {
super.onResume();
EasyTracker.getInstance(getActivity()).set(Fields.SCREEN_NAME, TAG);
EasyTracker.getInstance(getActivity()).send(MapBuilder.createAppView().build());
View view = getView();
// set the variables
TextView textViewTitle = (TextView) view
.findViewById(R.id.text_view_detail_title);
TextView textViewMetro = (TextView) view
.findViewById(R.id.text_view_detail_metro);
ImageView imageView = (ImageView) view
.findViewById(R.id.image_view_detail);
TextView textViewCoord = (TextView) view
.findViewById(R.id.text_view_detail_coordinates);
// populate the form
imageView.setOnLongClickListener(new CameraItemLongClickListener());
textViewTitle.setText(mCamera.getTitle());
textViewMetro.setText(mCamera.getCity() + ", NC " + mCamera.getZipCode());
BigDecimal latitude = new BigDecimal(mCamera.getLatitude()).setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal longitude = new BigDecimal(mCamera.getLongitude()).setScale(3, BigDecimal.ROUND_HALF_UP);
textViewCoord.setText(latitude + getString(R.string.latitude) + ", " +
longitude + getString(R.string.longitude));
MainActivity.getImageWorker().loadImage(mCamera.getUrl(), imageView, mCamera);
}
示例6: onResume
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onResume() {
EasyTracker.getInstance(getActivity()).set(Fields.SCREEN_NAME, TAG);
EasyTracker.getInstance(getActivity()).send(MapBuilder.createAppView().build());
mAdapterView.setSelection(mCurrentIndex);
if(mWasPaused) {
new GetCameras(getActivity(), MainActivity.getDBHelper(),
new PostGetCamerasListener()).execute(mQueryType);
mWasPaused = false;
}
super.onResume();
}
示例7: addCustomDimensionsToTracker
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
private void addCustomDimensionsToTracker(Tracker tracker) {
for (Entry<String, String> entry : customDimensions.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
//System.out.println("Setting tracker dimension slot " + key + ": <" + value+">");
tracker.set(Fields.customDimension(Integer.parseInt(key)), value);
}
}
示例8: sendEzCustomMetric
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
public static void sendEzCustomMetric(EasyTracker easyTracker, String screenName, int index, String metricValue) {
// Custom metric value sent is with this screen view.
easyTracker.send(MapBuilder
.createAppView()
.set(Fields.SCREEN_NAME, screenName)
.set(Fields.customMetric(index), metricValue)
.build()
);
}
示例9: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipe Details");
tracker.send(MapBuilder.createAppView().build());
}
示例10: onResume
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onResume() {
super.onResume();
String fragmentName = ((Object) this).getClass().getSimpleName();
// Send data to Google Analytics
mTracker.set(Fields.SCREEN_NAME, fragmentName);
mTracker.send(MapBuilder.createAppView().build());
// Send data to Mixpanel
((FlowApplication) getActivity().getApplication()).track("Impression: " + fragmentName);
}
示例11: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onStart() {
// GA tracking
OmniNotes.getGaTracker().set(Fields.SCREEN_NAME, getClass().getName());
OmniNotes.getGaTracker().send(MapBuilder.createAppView().build());
super.onStart();
}
示例12: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onStart() {
// GA tracking
OmniNotes.getGaTracker().set(Fields.SCREEN_NAME, getClass().getName());
OmniNotes.getGaTracker().send(MapBuilder.createAppView().build());
super.onStart();
}
示例13: onStart
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Override
public void onStart() {
// GA tracking
OmniNotes.getGaTracker().set(Fields.SCREEN_NAME, getClass().getName());
OmniNotes.getGaTracker().send(MapBuilder.createAppView().build());
super.onStart();
}
示例14: init
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Kroll.method
public void init( String trackingId, boolean dryRun, boolean manualSession, boolean async, int dispatch){
async_state = async;
if( async_state == false ){
GAServiceManager.getInstance().setLocalDispatchPeriod(dispatch);
}
mInstance.setDryRun(dryRun);
tracker = mInstance.getTracker(trackingId);
if( manualSession == true ){
tracker.set(Fields.SESSION_CONTROL, "start");
}
}
示例15: trackScreen
import com.google.analytics.tracking.android.Fields; //导入依赖的package包/类
@Kroll.method
public void trackScreen(String screen){
tracker.set(Fields.SCREEN_NAME, screen);
tracker.send(MapBuilder.createAppView().build());
if( async_state == true ){
GAServiceManager.getInstance().dispatchLocalHits();
}
}