Browse By

Android – Add Native Google +1 button in Android Application

Android - Add Native Google +1 button in Android ApplicationGoogle +1 : Google +1 button will help you to recommend   your android app.

Do you want to add Google+1 button into your android application? Today I am going to show you how to add native Google +1 button in Android Application.

Android – Add Native Google +1 button in Android Application

  1. First of all create project
  2. Add latest Google play service dependency in your app gradle.
    Here I have addedcompile ‘’


  3. Now add Internet permission in your project’s AndroidManifest.xml 
    <uses-permission android:name="android.permission.INTERNET"/>


    4. Now add google play service version meta-data in AndroidManifest.xml

    android:value="@integer/google_play_services_version" />

5. Add native +1 button (PlusOneButton) to your app

Add PlusOneButton in you layout xml file.

plus:annotation="inline" />

Please add below line without fail in control.



6. Now assign PlusOneButton to a member variable in your activity’s onCreate method.

protected void onCreate(Bundle savedInstanceState) {
    mPlusOneButton = (PlusOneButton) findViewById(;

7. Now add lines to your Activity’s onResume method to refresh PlusOneButton’s state each time the activity receives focus.

private static final int REQUEST_CODE = 0; 
private static final String APPURL = "YOUR_APP_URL_ON_GOOGLE_PLAY_STORE";
protected void onResume() { 
   mPlusOneButton.initialize(APPURL, REQUEST_CODE); 

8. You can use different type of size of PlusOneButton in layout xml like

plus:size=“standard” or plus:size=“small” or plus:size=“medium” or plus:size=“tall”

9. Also can use different annotation for PlusOneButton like plus:annotation=“inline” or plus:annotation=“bubble” or plus:annotation=“none” options.

I hope you like this article. Share your views to to improve content. Happy Coding !!!