Google+ Platform for Android

Recommend content with the +1 button

+1 annotations from your users can help their social connections find your site or app and can influence search positioning. Learn more about how Google uses social connections in search.

Add the native +1 button (PlusOneButton) to your app and configure the button to recommend rich content from your app. Your content must have a corresponding URL.

  1. 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" />
    
  2. Assign the PlusOneButton to a member variable in your Activity.onCreate handler.

    mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
    
  3. Refresh the PlusOneButton's state each time the activity receives focus in your Activity.onResume handler.

    // 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);
    }
    

Use of the +1 Button is subject to the Google+ Platform Buttons Policy

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.