Android Open Source - glvideoplayer-android Watch Item A P I






From Project

Back to project page glvideoplayer-android.

License

The source code is released under:

Apache License

If you think the Android project glvideoplayer-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.

Java Source Code

package net.binzume.android.nicovideo.webapi;
/*from   www. j  a  va  2s.c  o m*/
import java.util.ArrayList;
import java.util.List;

import net.binzume.android.nicovideo.NicoSession;
import net.binzume.android.nicovideo.util.HttpClient;

public class WatchItemAPI {
  public static final int TYPE_USER = 1;

  public static boolean add(NicoSession session, long itemType, String itemId) throws WebApiException {
    HttpClient client = new HttpClient();
    client.setCookie(session.cookie);
    // *
    String token = MyListAPI.getToken(client);

    HttpClient.Params params = new HttpClient.Params();
    params.put("item_type", "" + itemType);
    params.put("item_id", itemId);
    params.put("token", token);

    if (client.post(Constants.API_URL + "watchitem/add", params, false) == null) {
      return false;
    }

    return true;

  }

  public static boolean delete(NicoSession session, String itemIds) throws WebApiException {
    HttpClient client = new HttpClient();
    client.setCookie(session.cookie);
    // *
    String token = MyListAPI.getToken(client);

    HttpClient.Params params = new HttpClient.Params();
    params.put("id_list", itemIds);
    params.put("token", token);

    if (client.post(Constants.API_URL + "watchitem/delete", params, false) == null) {
      return false;
    }

    return true;
  }

  public static List<String> list(NicoSession session, String itemIds) throws WebApiException {
    HttpClient client = new HttpClient();
    client.setCookie(session.cookie);

    CharSequence data = client.getContent(Constants.API_URL + "watchitem/list");
    if (data.length() <= 0) {
      return null;
    }

    ArrayList<String> list = new ArrayList<String>();

    return list;
  }
}




Java Source Code List

net.binzume.android.glvideoplayer.DeviceCameraPlane.java
net.binzume.android.glvideoplayer.FBOTexture.java
net.binzume.android.glvideoplayer.GLShaderProgram.java
net.binzume.android.glvideoplayer.GLVideoRenderer.java
net.binzume.android.glvideoplayer.MainActivity.java
net.binzume.android.glvideoplayer.MediaPlayerPlane.java
net.binzume.android.glvideoplayer.NicoCommentPlane.java
net.binzume.android.glvideoplayer.OESTexture.java
net.binzume.android.glvideoplayer.TextureFactory.java
net.binzume.android.glvideoplayer.Texture.java
net.binzume.android.glvideoplayer.VideoSurfaceView.java
net.binzume.android.nicoplayer.player.CommentController.java
net.binzume.android.nicoplayer.player.CommentLoadTask.java
net.binzume.android.nicoplayer.player.CommentSlot.java
net.binzume.android.nicovideo.ChannelCategoryInfo.java
net.binzume.android.nicovideo.ChannelInfo.java
net.binzume.android.nicovideo.Comment.java
net.binzume.android.nicovideo.MyList.java
net.binzume.android.nicovideo.NicoSession.java
net.binzume.android.nicovideo.ThreadInfo.java
net.binzume.android.nicovideo.VideoFileInfo.java
net.binzume.android.nicovideo.VideoInfo.java
net.binzume.android.nicovideo.util.HtmlUtil.java
net.binzume.android.nicovideo.util.HttpClient.java
net.binzume.android.nicovideo.webapi.ChannelAPI.java
net.binzume.android.nicovideo.webapi.CommentAPI.java
net.binzume.android.nicovideo.webapi.Constants.java
net.binzume.android.nicovideo.webapi.FriendListAPI.java
net.binzume.android.nicovideo.webapi.LoginAPI.java
net.binzume.android.nicovideo.webapi.MyListAPI.java
net.binzume.android.nicovideo.webapi.NotLoginException.java
net.binzume.android.nicovideo.webapi.PaymentRequiredException.java
net.binzume.android.nicovideo.webapi.VideoAPI.java
net.binzume.android.nicovideo.webapi.VideoRssParser.java
net.binzume.android.nicovideo.webapi.VideoSearchAPI.java
net.binzume.android.nicovideo.webapi.WatchItemAPI.java
net.binzume.android.nicovideo.webapi.WebApiException.java