I am trying to use the google api to access picasa from android. I'm following a sample that parses atom by doing:
Album开发者_JAVA百科Feed feed = request.execute().parseAs(AlbumFeed.class);
In order for the atom parser to work I understand that I need to define classes that have a @Key annotation like:
public class Link {
@Key("@href")
public String href;
@Key("@rel")
public String rel;
}
But eclipse doesn't even compile this - I keep getting both: Key cannot be resolved as a type and The attribute value is undefined for the annotation type Key
I know you can define annotations in eclipse on the project but I thought you needed some processing class.
Any help is greatly appreciated - what are the steps to get eclipse to compile this so I can parse the Atom payload?
Once it compiles, I understand that I need to add -keepattributes Annotation,Signature if I use proguard. is that true? any other pitfalls?
You will need to add the jar file to your Android project. I am using android-maven-plugin these days, so the only thing I need is adding the following to my pom.xml,
<dependency>
<groupId>com.google.api.client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.4.1-beta</version>
</dependency>
@Key is from the class, com.google.api.client.util.Key. You can get the JAR file at http://code.google.com/p/google-api-java-client/wiki/Setup#Download_the_Zipped_Jars.
精彩评论