I am trying to use the Google generated API library for the first time for Android. I have taken code from the the Sample Program provided by Google. My code looks like
May be a bit late for this one, but the the jar that you're looking for is google-http-client-1.5.0-beta.jar
This jar defines com.google.api.client.http.* and com.google.api.client.json.*
Here is a list of the libraries you should have in you project: http://code.google.com/p/google-api-java-client/wiki/Setup
You must explicit add library reference of google-http-client-1.5.0-beta.jar(right click project->Properties->Java Build Path->Add External JARs), don't believe class path.
If you do not do this, in the apk file does not contain the required data。
You can download Google plus library from here google-plus-java-starter_v5.zip
plus = Plus.builder(transport, jsonFactory).setApplicationName("Google-PlusSample/1.0")
.setHttpRequestInitializer(accessProtectedResource)
.setJsonHttpRequestInitializer(new JsonHttpRequestInitializer() {
@Override
public void initialize(JsonHttpRequest request) {
PlusRequest plusRequest = (PlusRequest) request;
plusRequest.setPrettyPrint(true);
}
}).build();
use this instead of
Plus plus = new Plus(new NetHttpTransport(), new JacksonFactory());