# InstallReferrerClient

Summary:[Nested Classes](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#nestedclasses)\|[Ctors](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#pubctors)\|[Methods](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#)  

# InstallReferrerClient

`
public


abstract
class
InstallReferrerClient
`  
`

extends Object


``


`

|---|-------------------------------------------------------|
| java.lang.Object                                         ||
| ↳ | com.android.installreferrer.api.InstallReferrerClient |

<br />

*** ** * ** ***

Main interface for communication between the library and user application code.

## Summary

|                                                                                                ### Nested classes                                                                                                 ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`      | [InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) Builder to configure and create a InstallReferrer instance. |
| ` @interface` | [InstallReferrerClient.InstallReferrerResponse](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.InstallReferrerResponse) Possible return codes.      |

|                                                                  ### Public constructors                                                                  ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[InstallReferrerClient](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#InstallReferrerClient())`() ` |

|                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                           ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                                                                                                 | ` `[endConnection](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#endConnection())`() ` Close the connection and release all held resources such as service connections.                                                                                                                                                                                             |
| ` abstract `[ReferrerDetails](https://developer.android.com/reference/com/android/installreferrer/api/ReferrerDetails)                           | ` `[getInstallReferrer](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#getInstallReferrer())`() ` Get installation referrer details.                                                                                                                                                                                                                                 |
| ` abstract boolean`                                                                                                                              | ` `[isReady](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#isReady())`() ` Checks if the client is currently connected to the service, so that requests to other methods will succeed.                                                                                                                                                                              |
| ` static `[InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) | ` `[newBuilder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#newBuilder(android.content.Context))`(Context context) ` Constructs a new[InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder)instance.                                                                              |
| ` abstract void`                                                                                                                                 | ` `[startConnection](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#startConnection(com.android.installreferrer.api.InstallReferrerStateListener))`(`[InstallReferrerStateListener](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerStateListener)` listener) ` Starts up InstallReferrerClient setup process asynchronously. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#)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(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### InstallReferrerClient

```
InstallReferrerClient ()
```

<br />

<br />

## Public methods

### endConnection

```
void endConnection ()
```

Close the connection and release all held resources such as service connections.

Call this method once you are done with this InstallReferrerClient reference.

<br />

### getInstallReferrer

```
ReferrerDetails getInstallReferrer ()
```

Get installation referrer details. This method uses information stored by the Google Play Store app without initiating a network request.

<br />

|                                                                                                                                        Returns                                                                                                                                         ||
|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ReferrerDetails](https://developer.android.com/reference/com/android/installreferrer/api/ReferrerDetails) | ReferrerDetails The[ReferrerDetails](https://developer.android.com/reference/com/android/installreferrer/api/ReferrerDetails)with all install referrer information. <br /> |

|        Throws        ||
|-------------------|---|
| `RemoteException` |   |

### isReady

```
boolean isReady ()
```

Checks if the client is currently connected to the service, so that requests to other methods will succeed.

Returns true if the client is currently connected to the service, false otherwise.

Note: It also means that Install Referrer API is available for the current device.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### newBuilder

```
InstallReferrerClient.Builder newBuilder (Context context)
```

Constructs a new[InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder)instance.

<br />

|                                                     Parameters                                                      ||
|-----------|----------------------------------------------------------------------------------------------------------|
| `context` | `Context`: It will be used to get an application context to bind to the Install Referrer service. <br /> |

|                                                                    Returns                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------|--------|
| [InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) | <br /> |

### startConnection

```
void startConnection (InstallReferrerStateListener listener)
```

Starts up InstallReferrerClient setup process asynchronously. You will be notified through the[InstallReferrerStateListener](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerStateListener)listener when the setup process is complete.

<br />

|                                                  Parameters                                                   ||
|------------|---------------------------------------------------------------------------------------------------|
| `listener` | `InstallReferrerStateListener`: The listener to notify when the setup process is complete. <br /> |

-

  ## Annotations

  - [InstallReferrerClient.InstallReferrerResponse](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.InstallReferrerResponse)
-

  ## Interfaces

  - [InstallReferrerStateListener](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerStateListener)
-

  ## Classes

  - [InstallReferrerClient](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient)
  - [InstallReferrerClient.Builder](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient.Builder)
  - [ReferrerDetails](https://developer.android.com/reference/com/android/installreferrer/api/ReferrerDetails)