当前位置: 首页>>代码示例>>Java>>正文


Java Tracker.send方法代码示例

本文整理汇总了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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:21,代码来源:PlaylistsFragment.java

示例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());
    }
}
 
开发者ID:Lazyeraser,项目名称:DereHelper,代码行数:17,代码来源:Base.java

示例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());
}
 
开发者ID:adityabhaskar,项目名称:DoneForAndroid,代码行数:17,代码来源:Utils.java

示例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()
        );
    }
}
 
开发者ID:MuditSrivastava,项目名称:Canvas-Vision,代码行数:14,代码来源:MyApplication.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:13,代码来源:FoldersFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:36,代码来源:AlbumsFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:16,代码来源:SearchResultsFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:15,代码来源:PlaylistFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:16,代码来源:PlayerFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:36,代码来源:ArtistsFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:15,代码来源:VKAudioFragment.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:29,代码来源:VKAudioFragment.java

示例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;
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:37,代码来源:TaskGetPlaylistVK.java

示例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());
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:11,代码来源:NavigationActivity.java

示例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()
        );
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:19,代码来源:ApplicationLoader.java


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