java.lang.Object | ||||
↳ | com.kinvey.java.core.AbstractKinveyClient | |||
↳ | com.kinvey.java.core.AbstractKinveyJsonClient | |||
↳ | com.kinvey.java.AbstractClient | |||
↳ | com.kinvey.android.Client |
This class is an implementation of a com.kinvey.java.AbstractClient with default settings for the Android operating system.
Functionality is provided through a series of factory methods, which return the various API service wrappers.
These factory methods are all synchronized, and access is thread-safe. Once a service API has been retrieved,
it can be used to instantiate and execute asynchronous service calls. The Client.Builder
is not thread-safe.
The calling class can pass in a callback instance. Upon completion of the service call-- either success or failure will
be invoked. The Callback mechanism is null-safe, so null
can be passed if no callbacks are required.
All callback methods are null-safe, the callback will be ignored if null
is passed in.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | Client.Builder | Create a client for interacting with Kinvey's services from an Android Activity. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | TAG | global TAG used in Android logging |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
<T> AsyncAppData<T> |
appData(String collectionName, Class<T> myClass)
AppData factory method
Returns an instance of com.kinvey.java.AppData for the supplied collection. | ||||||||||
<I extends GenericJson, O extends GenericJson> AsyncCustomEndpoints<I, O> |
customEndpoints(Class<O> myClass)
Custom Endpoints factory method
Returns the instance of com.kinvey.java.CustomEndpoints used for executing RPC requests. | ||||||||||
AsyncCustomEndpoints |
customEndpoints()
Custom Endpoints factory method
Returns the instance of com.kinvey.java.CustomEndpoints used for executing RPC requests. | ||||||||||
AsyncFile |
file()
File factory method
Returns an instance of com.kinvey.java.File for uploading and downloading of files. | ||||||||||
Context |
getContext()
Get a reference to the Application Context used to create this instance of the Client
| ||||||||||
long |
getSyncRate()
How long, in milliseconds, should offline wait before retrying a failed request
| ||||||||||
<T extends LinkedGenericJson> AsyncLinkedData<T> |
linkedData(String collectionName, Class<T> myClass)
LinkedData factory method
Returns an instance of | ||||||||||
void |
ping(KinveyPingCallback callback)
Asynchronous Ping service method
Performs an authenticated ping against the configured Kinvey backend. | ||||||||||
AbstractPush |
push()
Push factory method
Returns the instance of | ||||||||||
void |
setContext(Context context)
Setter for the field | ||||||||||
AsyncUser |
user()
User factory method
Returns the instance of com.kinvey.java.User that contains the current active user. | ||||||||||
AsyncUserDiscovery |
userDiscovery()
UserDiscovery factory method
Returns the instance of com.kinvey.java.UserDiscovery used for searching for users. | ||||||||||
AsyncUserGroup |
userGroup()
UserGroup factory method
Returns the instance of com.kinvey.java.UserGroup used for managing user groups. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
global TAG used in Android logging
AppData factory method
Returns an instance of com.kinvey.java.AppData for the supplied collection. A new instance is created for each collection, but
only one instance of AsyncAppData
is created per collection. The method is Generic and takes an instance of a
com.google.api.client.json.GenericJson entity type that is used for fetching/saving of com.kinvey.java.AppData.
This method is thread-safe.
Sample Usage:
AppData<myEntity> myAppData = kinveyClient.appData("entityCollection", myEntity.class);
collectionName | The name of the collection |
---|---|
myClass | The class that defines the entity of type com.google.api.client.json.GenericJson used for saving and fetching of data |
Custom Endpoints factory method
Returns the instance of com.kinvey.java.CustomEndpoints used for executing RPC requests. Only one instance of Custom Endpoints is created for each instance of the Kinvey Client.
This method is thread-safe.
Sample Usage:
AsyncCustomEndpoints<MyRequestClass, MyResponseClass> endpoints = getClient().customEndpoints(MyResponseClass.class);
Custom Endpoints factory method
Returns the instance of com.kinvey.java.CustomEndpoints used for executing RPC requests. Only one instance of Custom Endpoints is created for each instance of the Kinvey Client.
This method is thread-safe.
Sample Usage:
CustomEndpoints myCustomEndpoints = kinveyClient.customEndpoints();
File factory method
Returns an instance of com.kinvey.java.File for uploading and downloading of files. Only one instance is created for each instance of the Kinvey client.
This method is thread-safe.
Sample Usage:
File myFile = kinveyClient.file();
Get a reference to the Application Context used to create this instance of the Client
null
or the live Application Context
How long, in milliseconds, should offline wait before retrying a failed request
LinkedData factory method
Returns an instance of AsyncLinkedData
for the supplied collection. A new instance is created for each collection, but
only one instance of LinkedData is created per collection. The method is Generic and takes an instance of a
LinkedGenericJson
entity type that is used for fetching/saving of AsyncLinkedData
.
This method is thread-safe.
Sample Usage:
LinkedData<myEntity> myAppData = kinveyClient.linkedData("entityCollection", myEntity.class);
collectionName | The name of the collection |
---|---|
myClass | The class that defines the entity of type LinkedGenericJson used for saving and fetching of data |
AsyncLinkedData
for the defined collection
Asynchronous Ping service method
Performs an authenticated ping against the configured Kinvey backend.
Sample Usage:
kinveyClient.ping(new KinveyPingCallback() {
onSuccess(Boolean result) { ...
onFailure(Throwable error) { ... }
}
}
callback | object of type KinveyPingCallback to be notified when request completes
|
---|
Push factory method
Returns the instance of AbstractPush
used for configuring Push. Only one instance of
AbstractPush
is created for each instance of the Kinvey Client.
This method is thread-safe.
Sample Usage:
AbstractPush myPush = kinveyClient.push();
AbstractPush
for the defined collection
Setter for the field context
.
context | a android.content.Context object. |
---|
User factory method
Returns the instance of com.kinvey.java.User that contains the current active user. If no active user context has been established, the com.kinvey.java.User object returned will be instantiated and empty.
This method is thread-safe.
Sample Usage:
User currentUser = kinveyClient.currentUser();
UserDiscovery factory method
Returns the instance of com.kinvey.java.UserDiscovery used for searching for users. Only one instance of UserDiscovery is created for each instance of the Kinvey Client.
This method is thread-safe.
Sample Usage:
UserDiscovery myUserDiscovery = kinveyClient.userDiscovery();
UserGroup factory method
Returns the instance of com.kinvey.java.UserGroup used for managing user groups. Only one instance of UserGroup is created for each instance of the Kinvey Client.
This method is thread-safe.
Sample Usage:
UserGroup myUserGroup = kinveyClient.userGroup();