API Reference

com.kinvey.android

Class Client<T extends User>

  • com.kinvey.android.Client<T>


  • public class Client<T extends User>

    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 class 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.

    See Also:
    class Client.Builder
    • Field Detail

      • TAG

        public static java.lang.String TAG

        global TAG used in Android logging

    • Constructor Detail

      • Client

        public Client(com.google.api.client.http.HttpTransport transport,
                      com.google.api.client.http.HttpRequestInitializer httpRequestInitializer,
                      java.lang.String rootUrl,
                      java.lang.String servicePath,
                      com.google.api.client.json.JsonObjectParser objectParser,
                      com.kinvey.java.core.KinveyClientRequestInitializer kinveyRequestInitializer,
                      com.kinvey.java.auth.CredentialStore store,
                      com.google.api.client.http.BackOffPolicy requestPolicy,
                      byte[] encryptionKey,
                      android.content.Context context)

        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 class 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.

        See Also:
        class Client.Builder
    • Method Detail

      • getContext

        public android.content.Context getContext()

        Get a reference to the Application Context used to create this instance of the Client

        Returns:
        null or the live Application Context
      • setContext

        public void setContext(android.content.Context p)

        Get a reference to the Application Context used to create this instance of the Client

      • getClientUser

        public com.kinvey.java.auth.ClientUser getClientUser()
      • setClientUser

        public void setClientUser(com.kinvey.java.auth.ClientUser p)
      • getSyncRate

        public long getSyncRate()

        How long, in milliseconds, should offline wait before retrying a failed request

        Returns:
        the number of milliseconds for offline sync to wait between failures
      • getBatchRate

        public long getBatchRate()
      • getNumberThreadPool

        public int getNumberThreadPool()
      • getBatchSize

        public int getBatchSize()
      • isClientRequestMultithreading

        public boolean isClientRequestMultithreading()
      • getCacheManager

        public com.kinvey.java.cache.ICacheManager getCacheManager()
      • setCacheManager

        public void setCacheManager(com.kinvey.java.cache.ICacheManager p)
      • getPushServiceClass

        public java.lang.Class<?> getPushServiceClass()
      • setPushServiceClass

        public void setPushServiceClass(java.lang.Class<?> p)
      • getActiveUser

        public T getActiveUser()
      • setActiveUser

        public void setActiveUser(T value)
      • getUserCacheManager

        public com.kinvey.java.cache.ICacheManager getUserCacheManager()
      • setUserCacheManager

        public void setUserCacheManager(com.kinvey.java.cache.ICacheManager p)
      • getSyncCacheManager

        public com.kinvey.java.cache.ICacheManager getSyncCacheManager()
      • setSyncCacheManager

        public void setSyncCacheManager(com.kinvey.java.cache.ICacheManager p)
      • getUser

        public T getUser()
      • setUser

        public void setUser(T p)
      • getDeviceId

        public java.lang.String getDeviceId()
      • getFileCacheFolder

        public java.lang.String getFileCacheFolder()
      • setFileCacheFolder

        public void setFileCacheFolder(java.lang.String p)
      • getFileStore

        public FileStore getFileStore(com.kinvey.java.store.StoreType storeType)
      • performLockDown

        public void performLockDown()
      • customEndpoints

        public <I extends GenericJson,O> AsyncCustomEndpoints<I,O> customEndpoints()
        Deprecated. 

        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:

        Returns:
        Instance of com.kinvey.java.UserDiscovery for the defined collection
      • customEndpoints

        public <I extends GenericJson,O> AsyncCustomEndpoints<I,O> customEndpoints(java.lang.Class<O> myClass)

        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:

        Returns:
        Instance of com.kinvey.java.UserDiscovery for the defined collection
      • userDiscovery

        public AsyncUserDiscovery userDiscovery()

        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:

        Returns:
        Instance of com.kinvey.java.UserDiscovery for the defined collection
      • userGroup

        public AsyncUserGroup userGroup()

        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:

        Returns:
        Instance of com.kinvey.java.UserGroup for the defined collection
      • ping

        public void ping(KinveyPingCallback callback)

        Asynchronous Ping service method

        Performs an authenticated ping against the configured Kinvey backend.

        Sample Usage:

        Parameters:
        callback - object of type interface KinveyPingCallback to be notified when request completes
      • stopKinveyHandlerThread

        public void stopKinveyHandlerThread()

        Terminates KinveyHandlerThread. Should be called if the Client instance is not used anymore to prevent from memory leaks. Currently this method is called from Instrumented tests, since each test has its own Client instance.

      • sharedInstance

        public static Client<com.kinvey.android.model.User> sharedInstance()