GooglePlusUtil | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Constants | Methods | Inherited Methods | [Expand All]
public class

# GooglePlusUtil

extends Object

java.lang.Object
↳ | com.google.android.gms.plus.GooglePlusUtil

## Class Overview

Utility class for verifying that the Google+ app is available and up-to-date on this device.

## Summary

Constants
int | APP_DISABLED | Status code indicating the Google+ app is installed, but disabled.
int | APP_MISSING | Status code indicating the Google+ app is not installed.
int | APP_UPDATE_REQUIRED | Status code indicating the Google+ app is installed, but is older than the version required.
String | GOOGLE_PLUS_PACKAGE | The package name of the Google+ Android app.
String | PLATFORM_LOGGING_TAG | Property to enable logging across the Google+ platform for Android.
int | SUCCESS | Status code indicating the Google+ app is installed and up-to-date.

Public Methods
static int | checkGooglePlusApp(Context context) Checks if the version of the Google+ app installed on this device is up-to-date.
static Dialog | getErrorDialog(int errorCode, Activity activity, int requestCode) Returns a dialog to address the provided errorCode.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final int APP_DISABLED

Status code indicating the Google+ app is installed, but disabled.

Constant Value: 3 (0x00000003)

#### public static final int APP_MISSING

Status code indicating the Google+ app is not installed.

Constant Value: 1 (0x00000001)

#### public static final int APP_UPDATE_REQUIRED

Status code indicating the Google+ app is installed, but is older than the version required.

Constant Value: 2 (0x00000002)

#### public static final String GOOGLE_PLUS_PACKAGE

The package name of the Google+ Android app.

Constant Value: "com.google.android.apps.plus"

#### public static final String PLATFORM_LOGGING_TAG

Property to enable logging across the Google+ platform for Android.

To enable logging:
`adb shell setprop log.tag.GooglePlusPlatform VERBOSE`

To disable logging:
`adb shell setprop log.tag.GooglePlusPlatform ""`

Constant Value: "GooglePlusPlatform"

#### public static final int SUCCESS

Status code indicating the Google+ app is installed and up-to-date.

Constant Value: 0 (0x00000000)

## Public Methods

#### public static int checkGooglePlusApp (Context context)

Checks if the version of the Google+ app installed on this device is up-to-date.

##### Parameters

context | The context.

##### Returns

- One of the status codes that is defined by this class: `APP_DISABLED`, `APP_MISSING`, `APP_UPDATE_REQUIRED`, or `SUCCESS`

#### public static Dialog getErrorDialog (int errorCode, Activity activity, int requestCode)

Returns a dialog to address the provided errorCode. Upon confirmation, the user is directed to either the Google Play Store or the System App Settings screen to resolve the error.

##### Parameters

errorCode | error code returned by `checkGooglePlusApp(Context)` call. If errorCode is `SUCCESS` then null is returned.
activity | parent activity for creating the dialog, also used for identifying language to display dialog in.
requestCode | The requestCode given when calling `startActivityForResult(Intent, int)`.