Hi,
I was not able to authenticate to the picasa webalbums by using API.
My code goes like this::
import java.net.URL;
import com.google.gdata.client.docs.DocsService;
import com.google.gdata.client.http.AuthSubUtil;
import com.google.gdata.client.photos.PicasawebService;
import com.google.gdata.data.docs.DocumentListEntry;
import com.google.gdata.data.docs.DocumentListFeed;
import com.google.gdata.data.photos.AlbumEntry;
import com.google.gdata.data.photos.AlbumFeed;
import com.google.gdata.data.photos.PhotoEntry;
import com.google.gdata.data.photos.UserFeed;
import com.google.gdata.util.AuthenticationException;
public class TestDocumentsList {
public static void main(String[] args) {
try {
System.out.println("111111");
PicasawebService myService = new
PicasawebService("exampleCo-
exampleApp-1");
System.out.println("222222");
myService.setUserCredentials("[email protected]",
"piasaex123");
System.out.println("333333");
String requestUrl =
AuthSubUtil.getRequestUrl("http://
www.example.com/RetrieveToken","http://picasaweb.google.com/data/",false,true);
System.out.println("4444444");
URL feedUrl = new
URL("http://picasaweb.google.com/data/feed/api/
user/[email protected]?kind=album");
UserFeed myUserFeed = myService.getFeed(feedUrl,
UserFeed.class);
for (AlbumEntry myAlbum : myUserFeed.getAlbumEntries())
{
System.out.println(myAlbum.getTitle().getPlainText());
}
URL feedUrl1 = new
URL("http://picasaweb.google.com/data/feed/api/
user/[email protected]/albumid/1");
AlbumFeed feed = myService.getFeed(feedUrl,
AlbumFeed.class);
for(PhotoEntry photo : feed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
the outPut coming like this::
1111111
2222222
After this i was not getting other output like 3333,444444 and etc...
I am having a problem with
myservice.setUserCredentials("username", "password");
Please Provide the solution for this Issue, thanking in advance
--
You received this message because you are subscribed to the Google Groups
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-picasa-data-api?hl=en.