Back to project page Music-Share-Android.
The source code is released under:
GNU General Public License
If you think the Android project Music-Share-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.weibo.sdk.android.api; /*from ww w .j av a2s.c o m*/ import com.weibo.sdk.android.Oauth2AccessToken; import com.weibo.sdk.android.WeiboParameters; import com.weibo.sdk.android.net.RequestListener; /** * * ??????????????????<a href=http://open.weibo.com/wiki/API%E6%96%87%E6%A1%A3_V2#.E5.85.B3.E7.B3.BB">??????</a> * @author xiaowei6@staff.sina.com.cn * */ public class FriendshipsAPI extends WeiboAPI { public FriendshipsAPI(Oauth2AccessToken accessToken) { super(accessToken); } private static final String SERVER_URL_PRIX = API_SERVER + "/friendships"; /** * ??????????? * * @param uid ????????UID? * @param count ?????????????????50???????200? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param trim_status ????user????status?????false?????status????true?status?????status_id????true? * @param listener */ public void friends( long uid, int count, int cursor, boolean trim_status, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("cursor", cursor); if (trim_status) { params.add("trim_status", 1); } else { params.add("trim_status", 0); } request( SERVER_URL_PRIX + "/friends.json", params, HTTPMETHOD_GET, listener); } /** * ??????????? * * @param screen_name ??????????? * @param count ?????????????????50???????200? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param trim_status ????user????status?????false?????status????true?status?????status_id????true? * @param listener */ public void friends( String screen_name, int count, int cursor, boolean trim_status, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); params.add("count", count); params.add("cursor", cursor); if (trim_status) { params.add("trim_status", 0); } else { params.add("trim_status", 1); } request( SERVER_URL_PRIX + "/friends.json", params, HTTPMETHOD_GET, listener); } /** * ???????????????????? * * @param uid ??????????????????UID? * @param suid ??????????????????UID???????????? * @param count ?????????????????50? * @param page ????????????1? * @param trim_status ????user????status?????false?????status????true?status?????status_id????true? * @param listener */ public void inCommon( long uid, long suid, int count, int page, boolean trim_status, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("suid", suid); params.add("count", count); params.add("page", page); if (trim_status) { params.add("trim_status", 1); } else { params.add("trim_status", 0); } request( SERVER_URL_PRIX + "/friends/in_common.json", params, HTTPMETHOD_GET, listener); } /** * ????????????????????????? * * @param uid ????????????????????UID? * @param count ?????????????????50? * @param page ????????????1? * @param listener */ public void bilateral( long uid, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/friends/bilateral.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????????ID????????UID?? * * @param uid ????????????????????UID? * @param count ?????????????????50???????2000? * @param page ????????????1? * @param listener */ public void bilateralIds( long uid, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/friends/bilateral/ids.json", params, HTTPMETHOD_GET, listener); } /** * ???????????UID?? * * @param uid ????????UID? * @param count ?????????????????500???????5000? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param listener */ public void friendsIds( long uid, int count, int cursor, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("cursor", cursor); request( SERVER_URL_PRIX + "/friends/ids.json", params, HTTPMETHOD_GET, listener); } /** * ???????????UID?? * * @param screen_name ??????????? * @param count ?????????????????500???????5000? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param listener */ public void friendsIds( String screen_name, int count, int cursor, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); params.add("count", count); params.add("cursor", cursor); request( SERVER_URL_PRIX + "/friends/ids.json", params, HTTPMETHOD_GET, listener); } /** * ????????????(????5000???????) * * @param uid ????????UID? * @param count ?????????????????50???????200? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param trim_status ????user????status?????false?????status????true?status?????status_id????false? * @param listener */ public void followers( long uid, int count, int cursor, boolean trim_status, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("cursor", cursor); if (trim_status) { params.add("trim_status", 0); } else { params.add("trim_status", 1); } request( SERVER_URL_PRIX + "/followers.json", params, HTTPMETHOD_GET, listener); } /** * ????????????(????5000???????) * * @param screen_name ??????????? * @param count ?????????????????50???????200? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param trim_status ????user????status?????false?????status????true?status?????status_id????false? * @param listener */ public void followers( String screen_name, int count, int cursor, boolean trim_status, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); params.add("count", count); params.add("cursor", cursor); if (trim_status) { params.add("trim_status", 0); } else { params.add("trim_status", 1); } request( SERVER_URL_PRIX + "/followers.json", params, HTTPMETHOD_GET, listener); } /** * ????????????UID?? * * @param uid ????????UID? * @param count ?????????????????500???????5000? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param listener */ public void followersIds( long uid, int count, int cursor, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("cursor", cursor); request( SERVER_URL_PRIX + "/followers/ids.json", params, HTTPMETHOD_GET, listener); } /** * ????????????UID?? * * @param screen_name ??????????? * @param count ?????????????????500???????5000? * @param cursor ?????????????????next_cursor?????previous_cursor????0? * @param listener */ public void followersIds( String screen_name, int count, int cursor, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); params.add("count", count); params.add("cursor", cursor); request( SERVER_URL_PRIX + "/followers/ids.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????? * * @param uid ????????UID? * @param count ?????????????20???????200? * @param listener */ public void followersActive( long uid, int count, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); request( SERVER_URL_PRIX + "/followers/active.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????????????????? * * @param uid ?????????UID? * @param count ?????????????????50? * @param page ????????????1? * @param listener */ public void chainFollowers( long uid, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/friends_chain/followers.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param source_id ?????UID? * @param target_id ?????UID? * @param listener */ public void show( long source_id, long target_id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("source_id", source_id); params.add("target_id", target_id); request( SERVER_URL_PRIX + "/show.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param source_id ?????UID? * @param target_screen_name ??????????? * @param listener */ public void show( long source_id, String target_screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("source_id", source_id); params.add("target_screen_name", target_screen_name); request( SERVER_URL_PRIX + "/show.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param source_screen_name ???????????? * @param target_id ?????UID? * @param listener */ public void show( String source_screen_name, long target_id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("source_screen_name", source_screen_name); params.add("target_id", target_id); request( SERVER_URL_PRIX + "/show.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param source_screen_name ???????????? * @param target_screen_name ??????????? * @param listener */ public void show( String source_screen_name, String target_screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("target_screen_name", target_screen_name); params.add("source_screen_name", source_screen_name); request(SERVER_URL_PRIX + "/show.json", params, HTTPMETHOD_GET, listener); } /** * ?????? * * @param uid ????????ID? * @param screen_name ??????????? * @param listener */ public void create( long uid, String screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("screen_name", screen_name); request( SERVER_URL_PRIX + "/create.json", params, HTTPMETHOD_POST, listener); } /** * ?????? * * @param screen_name ??????????? * @param listener */ @Deprecated public void create( String screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); request( SERVER_URL_PRIX + "/create.json", params, HTTPMETHOD_POST, listener); } /** * ?????????? * * @param uid ????????????ID? * @param screen_name ??????????????? * @param listener */ public void destroy(long uid, String screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("screen_name", screen_name); request( SERVER_URL_PRIX + "/destroy.json", params, HTTPMETHOD_POST, listener); } /** * ?????????? * * @param screen_name ??????????????? * @param listener */ @Deprecated public void destroy(String screen_name, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("screen_name", screen_name); request( SERVER_URL_PRIX + "/destroy.json", params, HTTPMETHOD_POST, listener); } }