Kalimah
Kalimah

Reputation: 11437

Google+ java starter app for android gives blank screen?

I am trying to play around with the new Google+ api in android, however the started app provided by Google (http://code.google.com/p/google-plus-java-starter/) is not working as it suppose to. I imported into Eclipse, ran it on Android 2.3 selected my account and then had a blank screen. I am not sure what is wrong with the starter app.

Is there another sample app for Google+?

Upvotes: 1

Views: 778

Answers (2)

Anuj Verma
Anuj Verma

Reputation: 2859

Plus plus = new Plus(new NetHttpTransport(), new GsonFactory()); plus.setKey(YOUR_API_KEY);

        Person profile = plus.people().get(USER_ID).execute();
    System.out.println(profile.getDisplayName());

        List list = plus.activities().list(USER_ID, "public");
    list.setMaxResults(Long.parseLong("50"));

        ActivityFeed feed = list.execute();

            while (feed.getItems() != null) {
        for (Activity activity : feed.getItems()) {
            System.out.println(activity.getPlusObject().getContent());
        }               
    }

This code runs fine and gives me my public post without authentication. Refer http://plusapps.blogspot.com/

Upvotes: 0

Chirag Shah
Chirag Shah

Reputation: 3674

Do you have any public Google+ posts? If you don't have any public posts in google+, the application won't have anything to display.

If you would like to debug HTTP requests made to the API, simply add the line:

java.util.logging.Logger.getLogger("com.google.api.client").setLevel(java.util.logging.Level.ALL);

Then from the command prompt you need to run this:

adb shell setprop log.tag.HttpTransport DEBUG

Upvotes: 2

Related Questions