Adding a Google +1 button in Android App

I was just wondering if there was anyway to add a Google +1 button inside my Android app. I have seen a +1 on the Android Market so I would think there would be some way to do this.

Adding a Google +1 button in Android App not working

I’ve spend some good hours trying to put this thing in my app. I keep getting a The Google Play services resources were not found. Check your project configuration to ensure that the resources are in

Android Eclipse Adding button to an app

I am adding a new button to an existing Android app. Here’s what I’ve done. Added the XML the button to my main.xml file: <Button android:[email protected]+id/btnNewButton android:layout_width=fill_parent a

PlusOneActivity not starting when clicking +1 button in Android app

I am integrating a Google +1 button into my Android app. I am using the same fragment with a PlusOne button in my MainActivity and a child activity (SearchActivity). In the SearchActivity the button w

Any Google +1 button gem for Rails?

Is there any gem to insert google +1 button to your web page on rails app? If not is there some special rails way of adding a button?

Adding google analytics to an android app

I have a working android app and now want to add google analytics to it. I am following the instructions here: http://code.google.com/mobile/analytics/docs/android/ When I add the import statement: im

adding google ads to android app

i am tying to add google ads to my app(this is my 1st time). i have added the jar file also. Here is the xml. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schema

android: adding button to the title of the app?

Is it possible to add a button to the right corner of the app title? e.g., adding a refresh button to the title of Feed: my feeds? http://www.android.com/market/apps/feedr-lg-01.jpg

Adding a facebook logout button to an android app

I’m following the android facebook tutorial at: http://developers.facebook.com/docs/mobile/android/build/ I’m at step 7, adding a button to logout. The tutorial provides sample code, however I have a

Android icon/button like send button on Google+ app

I am trying to make something function exactly like the send comment button on the Google Plus app. Everything is easy enough to get working, but I can’t figure out the proper way to have the submit i

Adding Google Search Bar to Android App

I’d like to to add a Google search bar to my app. Then I would like only the title of the search results to show up in a list view. What would be the best way to go about doing this?

Answers

With the Google+ platform for Android, you are now able to integrate a native +1 button in your Android app.

1) You first need to initialize the PlusClient object in your Activity.

2) Include the PlusOneButton in your layout:

    <com.google.android.gms.plus.PlusOneButton
        xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
        android:id="@+id/plus_one_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        plus:size="standard"
        plus:annotation="inline" />

3) Assign the PlusOneButton to a member variable in your Activity.onCreate handler.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPlusClient = new PlusClient(this, this, this);
    mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
}

4) Refresh the PlusOneButton’s state each time the activity receives focus in your Activity.onResume handler.

protected void onResume() {
    super.onResume();
    // Refresh the state of the +1 button each time the activity receives focus.
    mPlusOneButton.initialize(mPlusClient, URL);
}

For more information, see https://developers.google.com/+/mobile/android/#recommend_content_with_the_1_button

the accepted answer is outdated….

XML :

<com.google.android.gms.plus.PlusOneButton
  xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
  android:id="@+id/plus_one_button"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  plus:size="standard"
  plus:annotation="inline" />

Activity :

// The request code must be 0 or greater.

    private static final int PLUS_ONE_REQUEST_CODE = 0;

protected void onResume() {
    super.onResume();
    // Refresh the state of the +1 button each time the activity receives focus.
    mPlusOneButton.initialize(URL, PLUS_ONE_REQUEST_CODE);
}

and even before that fallow this link :

https://developers.google.com/+/mobile/android/getting-started

To add google plus one, first you need to enable the API in developer console, then register your app with package name, then include the same in your app.

Here is the full example with detailed explanation.

http://www.feelzdroid.com/2014/09/google-plusone-1-button-in-android-application-integration-guide.html