public class PicasaAlbumList extends Activity{
private ListView albumList;
private ArrayAdapter<String> albumListAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.picasa_album_list);
albumList = (ListView)findViewById(R.id.album_list_items);
albumListAdapter = new ArrayAdapter<String>(this, R.layout.picasa_album_name);
try {
init();
} catch (AuthenticationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void init() throws IOException, ServiceException
{
Intent intent = getIntent();
String id = intent.getStringExtra("ID");
String pw = intent.getStringExtra("PW");
PicasawebService myService = new PicasawebService("app name");
myService.setUserCredentials(id, pw); // 여기서 죽습니다.
URL feedUrl = new URL("http://picasaweb.google.com/data/feed/api/user/username?kind=album");
UserFeed myUserFeed = myService.getFeed(feedUrl, UserFeed.class);
for (AlbumEntry myAlbum : myUserFeed.getAlbumEntries()) {
albumListAdapter.add(myAlbum.getTitle().getPlainText());
//System.out.println(myAlbum.getTitle().getPlainText());
}
}
}
gdata 라이브러리를 사용하여 피카사에 접근하려고 합니다... api문서를 통해 간단하게 해보려고 다음과 같이 해봤는데
되지 않네요..
PicasawebService myService = new PicasawebService("app name"); 여기에 인수를 app 이름을 넣는게 맞는지 잘 모르겠네요..
초보라서 어디가 잘못됐는지 모르겠네요..ㅠㅠ
잘못된 부분 지적과 더불어 구글 피카사 연동에 대해 구현한 간단한 샘플코드 없을까요..
http://code.google.com/p/google-api-java-client/
요기에 들어가보면 안드로이드용 api가 있는것 같은데 샘플코드가 없습니다...
해당 라이브러리 사용해보신분 없으신가요...