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; //www . ja v a 2 s .c om 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/%E4%BD%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1">??????????</a> * @author luopeng (luopeng@staff.sina.com.cn) */ public class PlaceAPI extends WeiboAPI { public PlaceAPI(Oauth2AccessToken accessToken) { super(accessToken); } private static final String SERVER_URL_PRIX = API_SERVER + "/place"; /** * ???????????????????????? * * @param since_id ????????????ID?since_id???????????since_id?????????????0? * @param max_id ????????????ID??????max_id?????????0? * @param count ?????????????????50????20? * @param page ????????????1? * @param only_attentions true????????false????????????true? * @param listener */ public void friendsTimeline( long since_id, long max_id, int count, int page, boolean only_attentions, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("since_id", since_id); params.add("max_id", max_id); params.add("count", count); params.add("page", page); if (only_attentions) { params.add("type", 0); } else { params.add("type", 1); } request( SERVER_URL_PRIX + "/friends_timeline.json", params, HTTPMETHOD_GET, listener); } /** * ???????????????? * * @param uid ????????ID? * @param since_id ????????????ID?since_id???????????since_id?????????????0? * @param max_id ????????????ID??????max_id?????????0? * @param count ?????????????????50????20? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void userTimeline( long uid, long since_id, long max_id, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("since_id", since_id); params.add("max_id", max_id); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/user_timeline.json", params, HTTPMETHOD_GET, listener); } /** * ???????????????? * * @param poiid ??????POI?ID? * @param since_id ????????????ID?since_id???????????since_id?????????????0? * @param max_id ????????????ID??????max_id?????????0? * @param count ?????????????????50????20? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void poiTimeline( String poiid, long since_id, long max_id, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("since_id", since_id); params.add("max_id", max_id); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 0); } else { params.add("base_app", 1); } request( SERVER_URL_PRIX + "/poi_timeline.json", params, HTTPMETHOD_GET, listener); } /** * ???????????????? * * @param lat ????????-90.0?+90.0?+????? * @param lon ?????????-180.0?+180.0?+?????? * @param range ????????????????2000????11132?? * @param starttime ?????Unix???? * @param endtime ???????Unix???? * @param sort ???????????????????????????? * @param count ?????????????????50????20? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param offset ??????????????????false????????true??????????false? * @param listener */ public void nearbyTimeline( String lat, String lon, int range, long starttime, long endtime, SORT3 sort, int count, int page, boolean base_app, boolean offset, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("lat", lat); params.add("long", lon); params.add("range", range); params.add("starttime", starttime); params.add("endtime", endtime); params.add("sort", sort.ordinal()); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } if (offset) { params.add("offset", 1); } else { params.add("offset", 0); } request( SERVER_URL_PRIX + "/nearby_timeline.json", params, HTTPMETHOD_GET, listener); } /** * ????ID?????????? * * @param id ???????????ID? * @param listener */ public void statusesShow( long id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("id", id); request( SERVER_URL_PRIX + "/statuses/show.json", params, HTTPMETHOD_GET, listener); } /** * ????LBS?????????????? * * @param uid ????????ID? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void usersShow( long uid, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/users/show.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????? * * @param uid ????????ID? * @param count ?????????????????20????50? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void usersCheckins( long uid, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/users/checkins.json", params, HTTPMETHOD_GET, listener); } /** * ??????????? * * @param uid ????????ID? * @param count ?????????????????20????50? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void usersPhotos( long uid, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/users/photos.json", params, HTTPMETHOD_GET, listener); } /** * ??????????? * * @param uid ????????ID? * @param count ?????????????????20????50? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void usersTips( long uid, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", uid); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/users/tips.json", params, HTTPMETHOD_GET, listener); } /** * ???????? * * @param poiid ??????POI??ID? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void poisShow( String poiid, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/pois/show.json", params, HTTPMETHOD_GET, listener); } /** * ????????????????? * * @param poiid ??????POI??ID? * @param count ?????????????????20????50? * @param page ????????????1? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void poisUsers( String poiid, int count, int page, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("count", count); params.add("page", page); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/pois/users.json", params, HTTPMETHOD_GET, listener); } /** * ?????????? * * @param poiid ??????POI??ID? * @param count ?????????????????20????50? * @param page ????????????1? * @param sort ???????0??????1????????0?????????????? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void poisPhotos( String poiid, int count, int page, SORT2 sort, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("uid", poiid); params.add("count", count); params.add("page", page); params.add("sort", sort.ordinal()); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/pois/photos.json", params, HTTPMETHOD_GET, listener); } /** * ?????????? * * @param poiid ??????POI??ID? * @param count ?????????????????20????50 * @param page ????????????1? * @param sort ???????0??????1????????0?????????????? * @param base_app ??????????????????????false?????????????true??????????????false? * @param listener */ public void poisTips( String poiid, int count, int page, SORT2 sort, boolean base_app, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("count", count); params.add("page", page); params.add("sort", sort.ordinal()); if (base_app) { params.add("base_app", 1); } else { params.add("base_app", 0); } request( SERVER_URL_PRIX + "/pois/tips.json", params, HTTPMETHOD_GET, listener); } /** * ???????? * * @param keyword ??????? * @param city ???????????????? * @param category ??????????????????????????? * @param count ?????????????????20????50? * @param page ????????????1? * @param listener */ public void poisSearch( String keyword, String city, String category, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("keyword", keyword); params.add("city", city); params.add("category", category); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/pois/search.json", params, HTTPMETHOD_GET, listener); } /** * ???????? * * @param pid ???ID????0? * @param returnALL ???????????false?????????????true???????????false? * @param listener */ public void poisCategory( int pid, boolean returnALL, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("pid", pid); if (returnALL) { params.add("flag", 1); } else { params.add("flag", 0); } request( SERVER_URL_PRIX + "/pois/category.json", params, HTTPMETHOD_GET, listener); } /** * ???????? * * @param lat ????????-90.0?+90.0?+????? * @param lon ?????????-180.0?+180.0?+?????? * @param range ????????????2000????10000???????? * @param q ??????? * @param category ??????????????????????????? * @param count ?????????????????20????50? * @param page ????????????1? * @param offset ??????????????????false????????true??????????false? * @param listener */ public void nearbyPois( String lat, String lon, int range, String q, String category, int count, int page, boolean offset, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("lat", lat); params.add("long", lon); params.add("range", range); params.add("q", q); params.add("category", category); params.add("count", count); params.add("page", page); if (offset) { params.add("offset", 1); } else { params.add("offset", 0); } request( SERVER_URL_PRIX + "/nearby/pois.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????????? * * @param lat ????????-90.0?+90.0?+????? * @param lon ?????????-180.0?+180.0?+?????? * @param range ????????????2000????11132???????? * @param starttime ?????Unix???? * @param endtime ???????Unix???? * @param sort ???????0??????1?????????0? * @param count ?????????????????20????50? * @param page ????????????1? * @param offset ??????????????????false????????true??????????false? * @param listener */ public void nearbyUsers( String lat, String lon, int range, long starttime, long endtime, SORT3 sort, int count, int page, boolean offset, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("lat", lat); params.add("long", lon); params.add("range", range); params.add("starttime", starttime); params.add("endtime", endtime); params.add("sort", sort.ordinal()); params.add("count", count); params.add("page", page); if (offset) { params.add("offset", 1); } else { params.add("offset", 0); } request( SERVER_URL_PRIX + "/nearby/users.json", params, HTTPMETHOD_GET, listener); } /** * ???????? * * @param lat ????????-90.0?+90.0?+????? * @param lon ?????????-180.0?+180.0?+?????? * @param range ????????????500????11132???????? * @param starttime ?????Unix???? * @param endtime ???????Unix???? * @param sort ???????0??????1?????????0? * @param count ?????????????????20????50? * @param page ????????????1? * @param offset ??????????????????false????????true??????????false? * @param listener */ public void nearbyPhotos( String lat, String lon, int range, long starttime, long endtime, SORT3 sort, int count, int page, boolean offset, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("lat", lat); params.add("long", lon); params.add("range", range); params.add("starttime", starttime); params.add("endtime", endtime); params.add("sort", sort.ordinal()); params.add("count", count); params.add("page", page); if (offset) { params.add("offset", 1); } else { params.add("offset", 0); } request( SERVER_URL_PRIX + "/nearby/photos.json", params, HTTPMETHOD_GET, listener); } /** * ???????????????? * * @param poiid ??????POI??ID? * @param status ????????????????????140??? * @param pic ???????????????JPEG??GIF??PNG????????????5M????/sdcard/pic.jgp?????pic???????? * @param isPublic ???????????????????????? * @param listener */ public void poisAddCheckin( String poiid, String status, String pic, boolean isPublic, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("status", status); params.add("pic", pic); if (isPublic) { params.add("public", 1); } else { params.add("public", 0); } request( SERVER_URL_PRIX + "/pois/add_checkin.json", params, HTTPMETHOD_POST, listener); } /** * ???? * * @param poiid ????????POI??ID? * @param status ????????????????????140???? * @param pic ?????????????JPEG??GIF??PNG????????????5M????/sdcard/pic.jgp?????pic???????? * @param isPublic ???????????????????????? * @param listener */ public void poisAddPhoto( String poiid, String status, String pic, boolean isPublic, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("status", status); params.add("pic", pic); if (isPublic) { params.add("public", 1); } else { params.add("public", 0); } request( SERVER_URL_PRIX + "/pois/add_photo.json", params, HTTPMETHOD_POST, listener); } /** * ???? * * @param poiid ??????POI??ID? * @param status ????????????????????140???? * @param isPublic ???????????????????????? * @param listener */ public void poisAddTip( String poiid, String status, boolean isPublic, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("poiid", poiid); params.add("status", status); if (isPublic) { params.add("public", 1); } else { params.add("public", 0); } request( SERVER_URL_PRIX + "/pois/add_tip.json", params, HTTPMETHOD_POST, listener); } }