本文整理汇总了Java中com.google.android.gms.analytics.Tracker.send方法的典型用法代码示例。如果您正苦于以下问题:Java Tracker.send方法的具体用法?Java Tracker.send怎么用?Java Tracker.send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.analytics.Tracker
的用法示例。
在下文中一共展示了Tracker.send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
listView = (RecyclerView)view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
view.findViewById(R.id.fabNewPlaylist).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
newPlaylist();
}
});
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("List of playlists");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例2: init
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
public void init(BaseActivity activity){
baseActivity = activity;
activityStack.push(activity);
sh = new SharedHelper(activity.getApplicationContext());
loadingDialog = new LoadingDialog(activity);
loadingDialog.setOnCancelListener((dialogInterface -> canceled = true));
String screenName = activity.getClass().getSimpleName();
activityMap.put(screenName + System.currentTimeMillis(), activity);
if (SStaticR.ANALYTICS_ON){
// Obtain the shared Tracker instance.
LIVE application = (LIVE)baseActivity.getApplication();
Tracker mTracker = application.getDefaultTracker();
mTracker.setScreenName(screenName);
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
}
}
示例3: sendEvent
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
public static void sendEvent(Tracker tracker, String category, String action, String label) {
if (tracker == null)
return;
if (category == null || category.isEmpty())
category = Utils.ANALYTICS_CATEGORY_ACTION;
HitBuilders.EventBuilder analyticsEvent = new HitBuilders.EventBuilder()
.setCategory(category)
.setAction(action);
if (label != null && !label.isEmpty())
analyticsEvent.setLabel(label);
tracker.send(analyticsEvent.build());
}
示例4: trackException
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
public void trackException(Exception e) {
if (e != null) {
Tracker t = getGoogleAnalyticsTracker();
t.send(new HitBuilders.ExceptionBuilder()
.setDescription(
new StandardExceptionParser(this, null)
.getDescription(Thread.currentThread().getName(), e))
.setFatal(false)
.build()
);
}
}
示例5: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
listView = (RecyclerView) view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Folders and files");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例6: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view,savedInstanceState);
list = (RecyclerView)view.findViewById(android.R.id.list);
list.setItemAnimator(new DefaultItemAnimator());
setLayoutManager();
progress = (CircularProgressButton)view.findViewById(android.R.id.progress);
empty = view.findViewById(android.R.id.empty);
new AsyncTask<Void, Void, ArrayList<Track>>() {
@Override
protected void onPreExecute() {
super.onPreExecute();
activity.setRefreshing(true);
}
@Override
protected ArrayList<Track> doInBackground(Void... voids) {
return (ArrayList<Track>) FileUtils.read("albumsTracks", activity);
}
@Override
protected void onPostExecute(ArrayList<Track> tracks) {
super.onPostExecute(tracks);
activity.setRefreshing(false);
OnTaskResult(tracks);
}
}.execute();
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Albums");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例7: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
adapter = new PlayerAdapter(activity, this, playlistResultsLocal, playlistResultsVK);
listView = (RecyclerView) view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Playlist");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例8: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
adapter = new PlayerAdapter(activity, this, items);
listView = (RecyclerView) view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Playlist");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例9: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
adapter = new PlayerAdapter(activity, this, items);
listView = (RecyclerView) view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Now playing");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例10: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view,savedInstanceState);
list = (RecyclerView)view.findViewById(android.R.id.list);
list.setItemAnimator(new DefaultItemAnimator());
setLayoutManager();
progress = (CircularProgressButton)view.findViewById(android.R.id.progress);
empty = view.findViewById(android.R.id.empty);
new AsyncTask<Void, Void, ArrayList<Track>>() {
@Override
protected void onPreExecute() {
super.onPreExecute();
activity.setRefreshing(true);
}
@Override
protected ArrayList<Track> doInBackground(Void... voids) {
return (ArrayList<Track>) FileUtils.read("artistsTracks", activity);
}
@Override
protected void onPostExecute(ArrayList<Track> tracks) {
super.onPostExecute(tracks);
activity.setRefreshing(false);
OnTaskResult(tracks);
}
}.execute();
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("Artists");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例11: onViewCreated
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
adapter = new PlayerAdapter(activity, this, items);
listView = (RecyclerView) view.findViewById(android.R.id.list);
listView.setLayoutManager(new LinearLayoutManager(getActivity()));
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.setScreenName("VK audio");
t.send(new HitBuilders.AppViewBuilder().build());
}
示例12: update
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
public void update(boolean refresh) {
if (refresh) {
activity.setRefreshing(true);
items.clear();
page = 0L;
boolean isForeignVK = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean(getString(R.string.key_foreign_vk_popular), true);
TaskGetPlaylistVK task = new TaskGetPlaylistVK(activity, new TaskGetPlaylistVK.OnTaskGetPlaylistListener() {
@Override
public void OnTaskResult(ArrayList<Track> result) {
setItems(result, true);
}
});
if (TaskGetPlaylistVK.VK_METHOD_SEARCH.equals(method))
task.execute(method, String.valueOf(page += 1), searchQuery);
else
task.execute(method, String.valueOf(page += 1), String.valueOf(isForeignVK));
updateSnapshot();
listView.scrollToPosition(0);
setNeedUpdate(false);
} else
restoreCache();
Tracker t = ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.send(new HitBuilders.EventBuilder().setCategory("UX").setAction("vkAudio").setLabel(method + (refresh ? " (refresh)" : " (cache)")).build());
}
示例13: doInBackground
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
@Override
protected ArrayList<Track> doInBackground(String... params) {
Activity activity = mActivity.get();
if (null == activity) {
return null;
}
method = params[0];
long page = Long.valueOf(params[1]);
if (params.length > 2) {
if (TaskGetPlaylistVK.VK_METHOD_SEARCH.equals(method))
query = params[2];
if (TaskGetPlaylistVK.VK_METHOD_GET_POPULAR.equals(method))
isForeignPopular = Boolean.parseBoolean(params[2]);
}
List<VKApiAudio> audios = new ArrayList<VKApiAudio>();
if (VK_METHOD_GET.equals(method))
audios = getAudio("audio.get", "", VK_PAGE_SIZE, VK_PAGE_SIZE * (page - 1));
if (VK_METHOD_GET_POPULAR.equals(method))
audios = getAudio("audio.getPopular", "", VK_PAGE_SIZE, VK_PAGE_SIZE * (page - 1));
if (VK_METHOD_GET_RECOMMENDATIONS.equals(method))
audios = getAudio("audio.getRecommendations", "", VK_PAGE_SIZE, VK_PAGE_SIZE * (page - 1));
if (VK_METHOD_SEARCH.equals(method))
audios = getAudio("audio.search", query, VK_PAGE_SIZE, VK_PAGE_SIZE * (page - 1));
ArrayList<Track> tracks = new ArrayList<Track>();
for (VKApiAudio audio : audios)
tracks.add(Track.fromVKApiAudio(audio));
Tracker t = ((NavigationActivity)activity).getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.send(new HitBuilders.EventBuilder().setCategory("VK").setAction(method).build());
return tracks;
}
示例14: setShuffleMode
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
private void setShuffleMode(boolean mode){
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Shuffle", mode).commit();
mBoundService.setShuffle(mode);
if (playingFragment != null)
playingFragment.shuffleItems();
updatePlayPause();
Tracker t = getTracker(NavigationActivity.TrackerName.APP_TRACKER);
t.send(new HitBuilders.EventBuilder().setCategory("UX").setAction("shuffle").setLabel(String.valueOf(mode)).build());
}
示例15: trackException
import com.google.android.gms.analytics.Tracker; //导入方法依赖的package包/类
/***
* Tracking exception
*
* @param e exception to be tracked
*/
public void trackException(Exception e) {
if (e != null) {
Tracker t = getGoogleAnalyticsTracker();
t.send(new HitBuilders.ExceptionBuilder()
.setDescription(
new StandardExceptionParser(this, null)
.getDescription(Thread.currentThread().getName(), e))
.setFatal(false)
.build()
);
}
}