本文整理匯總了Java中com.google.analytics.tracking.android.EasyTracker類的典型用法代碼示例。如果您正苦於以下問題:Java EasyTracker類的具體用法?Java EasyTracker怎麽用?Java EasyTracker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EasyTracker類屬於com.google.analytics.tracking.android包,在下文中一共展示了EasyTracker類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: installExecutable
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
private void installExecutable() {
File file = new File(context.getFilesDir(), "screenrec");
try {
executable = file.getAbsolutePath();
if (Utils.isArm()) {
Utils.extractResource(context, R.raw.screenrec, file);
} else if (Utils.isX86()) {
Utils.extractResource(context, R.raw.screenrec_x86, file);
} else {
setState(ProcessState.CPU_NOT_SUPPORTED_ERROR);
return;
}
if (!file.setExecutable(true, false)) {
Log.w(TAG, "Can't set executable property on " + file.getAbsolutePath());
}
} catch (IOException e) {
Log.e(TAG, "Can't install native executable", e);
setState(ProcessState.INSTALLATION_ERROR);
EasyTracker.getTracker().sendEvent(ERROR, INSTALLATION_ERROR, INSTALLATION_ERROR, null);
EasyTracker.getTracker().sendException(Thread.currentThread().getName(), e, false);
}
}
示例2: onPostExecute
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@Override
protected void onPostExecute(Integer exitValue) {
if (exitValue != 0) {
return;
}
EasyTracker.getInstance().setContext(context); // for some reason context sometimes wasn't set here
EasyTracker.getTracker().sendEvent(ACTION, BUG, REPORT, null);
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("message/rfc822");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
String version = Utils.getAppVersionName(context);
String subject = context.getString(R.string.error_report_subject) + " " + context.getString(R.string.app_name) + " " + version + " - " + errorCode + " - " + Build.DEVICE + " - " + Build.VERSION.RELEASE ;
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, context.getString(R.string.error_report_text));
Uri reportUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", reportFile);
emailIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
emailIntent.putExtra(Intent.EXTRA_STREAM, reportUri);
Intent chooserIntent = Intent.createChooser(emailIntent, context.getString(R.string.error_report_chooser));
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(chooserIntent);
}
示例3: onDestroy
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@Override
public void onDestroy() {
if (state == RecorderServiceState.RECORDING || state == RecorderServiceState.STARTING) {
stopRecording();
EasyTracker.getTracker().sendEvent(ACTION, STOP, STOP_DESTROY, null);
}
startOnReady = false;
cameraOverlay.hide();
cameraOverlay.onDestroy();
recorderOverlay.animateHide();
recorderOverlay.onDestroy();
nativeProcessRunner.destroy();
if (projectionThreadRunner != null) {
projectionThreadRunner.destroy();
}
screenOffReceiver.unregister();
savePreferences();
Settings.getInstance().restoreShowTouches();
if (audioDriver.shouldUninstall()) {
audioDriver.uninstall();
}
audioDriver.removeInstallListener(this);
destroyed = true;
markShutDownCorrectly();
runningInstances--;
}
示例4: onCreate
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mApp = CatnutApp.getTingtingApp();
if (savedInstanceState == null) {
final FragmentManager fragmentManager = getFragmentManager();
fragmentManager.addOnBackStackChangedListener(this);
Intent intent = getIntent();
final long uid = intent.getLongExtra(Constants.ID, 0L);
Uri uri = intent.getData();
String screenName =
uri == null ? intent.getStringExtra(User.screen_name) : uri.getLastPathSegment();
fragmentManager
.beginTransaction()
.replace(android.R.id.content, ProfileFragment.getFragment(uid, screenName))
.commit();
if (mApp.getPreferences().getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
}
ActionBar bar = getActionBar();
bar.setIcon(R.drawable.ic_title_profile_default);
bar.setDisplayHomeAsUpEnabled(true);
}
示例5: onCreate
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (CatnutApp.getTingtingApp().getPreferences()
.getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
ActionBar bar = getActionBar();
bar.setIcon(R.drawable.ic_title_view_tweet);
bar.setDisplayHomeAsUpEnabled(true);
long id = getIntent().getLongExtra(Constants.ID, 0L);
String json = getIntent().getStringExtra(Constants.JSON);
if (savedInstanceState == null) {
TweetFragment fragment = id != 0L
? TweetFragment.getFragment(id)
: TweetFragment.getFragment(json);
// 添加back回調
mKeyDownListener = fragment;
getFragmentManager().beginTransaction()
.replace(android.R.id.content, fragment)
.commit();
}
}
示例6: setFavorite
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
private void setFavorite(boolean toFavorite) {
if(toFavorite) {
EasyTracker.getInstance(getActivity()).send(MapBuilder
.createEvent(Category.Favorite.name(), mCamera.getTitle(), "favorite", null)
.build());
} else {
EasyTracker.getInstance(getActivity()).send(MapBuilder
.createEvent(Category.Favorite.name(), mCamera.getTitle(), "unfavorite", null)
.build());
}
mCamera.setIsFavorite(toFavorite);
mFavoriteMenuItem.setVisible(!toFavorite);
mUnfavoriteMenuItem.setVisible(toFavorite);
new FavoriteCamera(toFavorite).execute(mCamera);
}
示例7: applicationStartup
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
/**
* @param savedInstanceState
*/
private void applicationStartup() {
if(GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS) {
mClient = new LocationClient(this, this, this);
mClient.connect();
} else {
EasyTracker.getInstance(this).send(MapBuilder
.createEvent(Category.Other.name(), "GooglePlayServicesNotAvailable", "", null)
.build());
}
mCities = mGetLatestCamerasTask.getCities();
mCacheParams = new ImageCacheParams("/image-cache");
setImageQuality();
configureAnalytics();
mImageWorker = new ImageFetcher(this, 400);
mImageWorker.setImageCache(ImageCache.findOrCreateCache(this,
mCacheParams));
mImageWorker.setLoadingImage(R.drawable.placeholder_camera);
mFragment.setIsProcessing(false);
mDrawerAdapter = new DrawerListAdapter(this,
Arrays.asList((getResources().getStringArray(R.array.drawer_list_groups))),
mCities);
mDrawerList.setAdapter(mDrawerAdapter);
selectGroup(mDrawerList, getCurrentGroup(), true);
}
示例8: onStatusBarNotificationSwitchChanged
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@OnCheckedChanged(R.id.settings_status_bar_notifications_track_now_scrobbling_switch)
public void onStatusBarNotificationSwitchChanged(boolean isChecked) {
if (isChecked == WAILSettings.isStatusBarNotificationTrackScrobblingEnabled(getActivity())) {
return;
}
WAILSettings.setStatusBarNotificationTrackScrobblingEnabled(getActivity(), isChecked);
if (isChecked) {
Track track = WAILSettings.getNowScrobblingTrack(getActivity());
if (track != null) {
StatusBarNotificationsManager.getInstance(getActivity())
.showTrackScrobblingStatusBarNotification(track);
}
setMinPriorityEnabled(true);
} else {
StatusBarNotificationsManager.getInstance(getActivity()).cancelAllNotifications();
setMinPriorityEnabled(false);
}
EasyTracker.getInstance(getActivity()).send(MapBuilder.createEvent(GA_EVENT_SETTINGS_STATUS_BAR_NOTIFICATIONS,
"nowPlayingStatusBarNotifications",
isChecked ? "enabled" : "disabled",
isChecked ? 1L : 0L).build());
}
開發者ID:artem-zinnatullin,項目名稱:android-wail-app,代碼行數:26,代碼來源:SettingsStatusBarNotificationsFragment.java
示例9: onItemClick
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
@OnItemClick(R.id.settings_select_language_list_view)
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
switch (i) {
case 0:
LocaleUtil.updateLanguage(getActivity(), Locale.getDefault().getDisplayLanguage());
break;
default:
String language = languages[i];
if (language.contains("(")) {
language = language.substring(0, language.indexOf("(") - 1);
}
LocaleUtil.updateLanguage(getActivity(), language);
break;
}
EasyTracker.getInstance(getActivity()).send(MapBuilder.createEvent(
GA_EVENT_SETTINGS_SELECT_LANGUAGE,
"languageChangedTo",
i == 0 ? "default" : languages[i],
0L
).build());
getActivity().finish();
}
示例10: onStart
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的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);
}
示例11: TrackerInst
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
public TrackerInst() {
try {
EasyTracker.getInstance().setContext(MyApplication.self);
tracker = EasyTracker.getTracker();
// Use custom exception reporter to avoid but in GA v2.0 beta 4
exceptionReporter = new ExceptionReporter(
tracker,
GAServiceManager.getInstance(),
Thread.getDefaultUncaughtExceptionHandler(),
MyApplication.self
);
exceptionReporter.setExceptionParser(new MyExceptionParser());
Thread.setDefaultUncaughtExceptionHandler(exceptionReporter);
} catch (Exception ex) {
Common.log(ex);
tracker = null;
}
}
示例12: getFragment
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
private Fragment getFragment() {
String action;
Fragment fragment;
if (mContentCache.album != null) {
fragment = ImgurAlbumFragment_.builder().mAlbum(mContentCache.album).build();
action = EventAction.VIEW_ALBUM;
}
else {
fragment = ImgurImageFragment_.builder().mImage(mContentCache.image).mLink(mLink).build();
action = EventAction.VIEW_IMAGE;
}
EasyTracker.getInstance(this).send(
MapBuilder.createEvent(
EventCategory.CONTENT,
action,
mLinkUrl,
null
).build()
);
return fragment;
}
示例13: sendNonFatalException
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
public static void sendNonFatalException(Context c, Throwable e) {
EasyTracker.getInstance(c).send(
MapBuilder.createException(
new StandardExceptionParser(c, null)
.getDescription(Thread.currentThread().getName(), e),
false) // False indicates a nonfatal exception
.build());
}
示例14: showMicrophoneBusyError
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
public void showMicrophoneBusyError(RecordingInfo recordingInfo) {
Intent intent = createDialogIntent(getString(R.string.microphone_busy_error_title));
intent.putExtra(DialogActivity.MESSAGE_EXTRA, getString(R.string.microphone_busy_error_message));
intent.putExtra(DialogActivity.POSITIVE_EXTRA, getString(R.string.microphone_busy_error_continue_mute));
intent.putExtra(DialogActivity.NEGATIVE_EXTRA, getString(R.string.settings_cancel));
intent.putExtra(DialogActivity.RESTART_EXTRA, true);
intent.putExtra(DialogActivity.RESTART_ACTION_EXTRA, RecorderService.RESTART_MUTE_ACTION);
context.startActivity(intent);
EasyTracker.getTracker().sendEvent(ERROR, RECORDING_ERROR, ERROR_ + recordingInfo.exitValue, null);
}
示例15: getOrientation
import com.google.analytics.tracking.android.EasyTracker; //導入依賴的package包/類
public Orientation getOrientation() {
Point s;
try {
DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
Display display = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
s = new Point();
display.getSize(s);
} catch (Exception e) {
Log.w(TAG, "Error retrieving screen orientation");
EasyTracker.getTracker().sendException("projection", e, false);
return Orientation.LANDSCAPE;
}
return s.x > s.y ? Orientation.LANDSCAPE : Orientation.PORTRAIT;
}