Summary: Constants | Inherited Constants | Methods | Inherited Methods | [Expand All]
public interface

# PlayerStats

implements Freezable<PlayerStats> Parcelable

com.google.android.gms.games.stats.PlayerStats

## Class Overview

The PlayerStats API allows you to retrieve information about the player's activity in your application. Your app can then use this data to provide a different experience for each type of player (eg. players with a high probably of quitting).

## Summary

Constants
float | UNSET_VALUE | The default value for each field when there isn't enough data to calculate.

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Public Methods
abstract float | getAverageSessionLength() The average session length of the player in minutes.
abstract float | getChurnProbability() The approximate probability of the player not returning to play the game.
abstract int | getDaysSinceLastPlayed() The approximate number of days since the player last played.
abstract float | getHighSpenderProbability() The probability that the player may spend a large amount relative to other players.
abstract int | getNumberOfPurchases() The approximate number of in-app purchases for the player.
abstract int | getNumberOfSessions() The approximate number of sessions of the player.
abstract float | getSessionPercentile() The approximation of sessions percentile for the player.
abstract float | getSpendPercentile() The approximate spend percentile of the player.
abstract float | getSpendProbability() The approximate probability of the player choosing to spend in this game.
abstract float | getTotalSpendNext28Days() The predicted amount in USD that the player will spend over the next 28 days.

[Expand] Inherited Methods
From interface com.google.android.gms.common.data.Freezable
abstract PlayerStats | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final float UNSET_VALUE

The default value for each field when there isn't enough data to calculate. Please check the value against this before using it.

Constant Value: -1.0

## Public Methods

#### public abstract float getAverageSessionLength ()

The average session length of the player in minutes. Session length is determined by the time that a player is signed in to Google Play Games services.

##### Returns

- A decimal number of minutes or `UNSET_VALUE`.

#### public abstract float getChurnProbability ()

The approximate probability of the player not returning to play the game. Higher values indicate that a player is less likely to return.

##### Returns

- A decimal number between 0 and 1 (inclusive) or `UNSET_VALUE`.

#### public abstract int getDaysSinceLastPlayed ()

The approximate number of days since the player last played.

##### Returns

- A number of days or `UNSET_VALUE`.

#### public abstract float getHighSpenderProbability ()

The probability that the player may spend a large amount relative to other players. Higher values indicate that a player is more likely to spend large amounts.

##### Returns

- A decimal number between 0 and 1 (inclusive) or `UNSET_VALUE`.

#### public abstract int getNumberOfPurchases ()

The approximate number of in-app purchases for the player.

##### Returns

- The count of player purchases or `UNSET_VALUE`.

#### public abstract int getNumberOfSessions ()

The approximate number of sessions of the player. Sessions are determined by the number of times that a player signs in to Google Play Games services.

##### Returns

- The count of player sessions or `UNSET_VALUE`.

#### public abstract float getSessionPercentile ()

The approximation of sessions percentile for the player. This value indicates how many sessions the current player has played in comparison to the rest of this game's player base. Higher numbers indicate that this player has played more sessions.

##### Returns

- A decimal number between 0 and 1 (inclusive) or `UNSET_VALUE`.

#### public abstract float getSpendPercentile ()

The approximate spend percentile of the player. This value indicates how much the current player has spent in comparison to the rest of this game's player base. Higher numbers indicate that this player has spent more.

##### Returns

- A decimal number between 0 and 1 (inclusive) or `UNSET_VALUE`.

#### public abstract float getSpendProbability ()

The approximate probability of the player choosing to spend in this game. Higher values indicate that a player is more likely to spend.

##### Returns

- A decimal number between 0 and 1 (inclusive) or `UNSET_VALUE`.

#### public abstract float getTotalSpendNext28Days ()

The predicted amount in USD that the player will spend over the next 28 days.

##### Returns

- The estimated spend total over the next 28 days in USD, or `UNSET_VALUE`.