各位大神,我最近参加了一个比赛。里面要求接入人人社区,但是,他不允许我们利用人人的API。所以,我要自己实现人人的功能,主要是上传照片和下载相册里面的照片。我打算使用HttpClient做。我想知道,有没有人有做过这个东西的经历。有的话,请指点一下。如果有别的Demo,那就最好了。跪求各位大神帮忙啊。
PS:

解决方案 »

  1.   

    登陆renren.com,然后获取相册信息,下载照片都简单,上传照片这个估计会有难度,我现在只是登陆renren.com,然后获取blog。http://blog.csdn.net/iisgirl/article/details/7519760上传照片,这个我稍后试试,试过之后才知道。
      

  2.   

    httpclient用过,比较熟悉这个了
      

  3.   

    不用API获取社交网络的信息,思路不错。
      

  4.   


    String urlPath = "http://m.haatalk.com:9527/file/upload";
    HttpClient client = new DefaultHttpClient();
    HttpPost post = new HttpPost(urlPath);
    MultipartEntity mpEntity = new MultipartEntity();
    //file为上传图片
    FileBody fileBody = new FileBody(file);
    mpEntity.addPart("file", fileBody);
    mpEntity.addPart("userId", new StringBody(uuid,Charset.forName(org.apache.http.protocol.HTTP.UTF_8)));
    }
    post.setEntity(mpEntity);
    HttpResponse response = client.execute(post);
    String content = EntityUtils.toString(response.getEntity());
    System.out.println(content);
    client.getConnectionManager().shutdown();
      

  5.   

    这个我知道,但是,那个比赛是这么要求的啊。
    他比较牛,不让我们用人人的SDK,我们只能苦逼地自己写。