コード例 #1
0
  /**
   * @설명 : Cyworld 사진첩 게시물 목록보기 @RequestURI :
   * https://apis.skplanetx.com/cyworld/minihome/{cyId}/albums/{folderNo}/items
   */
  private void initCyPhotoAlbumList(int folderNo) {

    // Querystring Parameters
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("page", 1); // 조회할 목록의 페이지를 지정합니다.
    map.put("count", 20); // 페이지당 출력되는 게시물 수를 지정합니다.

    // Bundle 생성
    RequestBundle bundle =
        AsyncRequester.make_GET_DELTE_bundle(
            this,
            Define.CYWORLD_MINIHOME_URI + mBestiesInfo.cyId + "/albums/" + folderNo + "/items",
            map);

    try {
      AsyncRequester.request(
          CyworldPhotoListActivity.this,
          bundle,
          HttpMethod.GET,
          new EntityParserHandler(
              new EntityCyPhoto(),
              new OnEntityParseComplete() {

                @Override
                public void onParsingComplete(Object entityArray) {
                  mPhotoArray = (ArrayList<EntityCyPhoto>) entityArray;

                  mPhotoAdapter.setCyworldPhotoList(mPhotoArray);
                  setListAdapter(mPhotoAdapter);
                }
              }));
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
    }
  }
コード例 #2
0
  /**
   * @설명 : Cyworld 사진첩 폴더 목록 보기 @RequestURI :
   * https://apis.skplanetx.com/cyworld/minihome/{cyId}/albums @RequestPathParam : {cyId} 조회할 대상의
   * 싸이월드 ID입니다
   */
  private void initCyPhotoFolderList() {

    // Querystring Parameters
    Map<String, Object> map = new HashMap<String, Object>();

    // Bundle 생성
    RequestBundle bundle =
        AsyncRequester.make_GET_DELTE_bundle(
            this, Define.CYWORLD_MINIHOME_URI + mBestiesInfo.cyId + "/albums", map);

    try {
      // API 호출
      AsyncRequester.request(
          CyworldPhotoListActivity.this,
          bundle,
          HttpMethod.GET,
          new EntityParserHandler(
              new EntityCyPhotoFolder(),
              new OnEntityParseComplete() {

                @Override
                public void onParsingComplete(Object entityArray) {
                  mFolderArray = (ArrayList<EntityCyPhotoFolder>) entityArray;

                  ArrayList<String> folderNameList = new ArrayList<String>();
                  folderNameList.add(getString(R.string.view_all));

                  for (int i = 0; i < mFolderArray.size(); i++) {
                    folderNameList.add(mFolderArray.get(i).folderName);
                  }

                  mSpinnerItems.addAll(folderNameList);
                  mSpinnerAdapter =
                      new ArrayAdapter<String>(
                          getApplicationContext(),
                          android.R.layout.simple_spinner_item,
                          mSpinnerItems);
                  mSpinnerAdapter.setDropDownViewResource(
                      android.R.layout.simple_spinner_dropdown_item);
                  mFolderSp.setAdapter(mSpinnerAdapter);
                  mFolderSp.setOnItemSelectedListener(mSpinnerSelectedListener);
                }
              }));
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
    }
  }