當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。