public class

AsyncCustomEndpoints

extends CustomEndpoints<I, O>
java.lang.Object
   ↳ com.kinvey.java.CustomEndpoints<I, O>
     ↳ com.kinvey.android.AsyncCustomEndpoints<I, O>

Class Overview

Wraps the com.kinvey.java.CustomEndpoints public methods in asynchronous functionality using native Android AsyncTask.

NOTE: It is the responsibility of the user to either use a KinveyListCallback or a KinveyClientCallback depending on what their Custom Endpoint returns.

Sample usage:

 mKinveyClient.customEndpoints().callEndpoint("myCustomCommand", null, new KinveyListCallback<GenericJson>() {
        public void onSuccess(GenericJson[] result) {
              results.setText(result[0].toString());
          
        public void onFailure(Throwable error) {
              results.setText("Uh oh -> " + error);
          }
      });
 }
 
The above sample assumes the Custom Endpoint takes no input null and returns an array of JSON objects.

Summary

Public Constructors
AsyncCustomEndpoints(AbstractClient client)
Constructor for this Asyncronous Custom Endpoint class
AsyncCustomEndpoints(Class<O> responseClass, AbstractClient client)
Constructor for this Asyncronous Custom Endpoint class
Public Methods
void callEndpoint(String commandName, I input, KinveyClientCallback callback)
Execute a Custom Endpoint which will return a single JSON object
void callEndpoint(String commandName, I input, KinveyListCallback callback)
Execute a Custom Endpoint which will return an array of JSON objects.
[Expand]
Inherited Methods
From class com.kinvey.java.CustomEndpoints
From class java.lang.Object

Public Constructors

public AsyncCustomEndpoints (AbstractClient client)

Constructor for this Asyncronous Custom Endpoint class

public AsyncCustomEndpoints (Class<O> responseClass, AbstractClient client)

Constructor for this Asyncronous Custom Endpoint class

Parameters
responseClass the class of the expected resposne object
client an active logged in client

Public Methods

public void callEndpoint (String commandName, I input, KinveyClientCallback callback)

Execute a Custom Endpoint which will return a single JSON object

Parameters
commandName - the name of the Command to execute
input - any required input, can be null
callback - get results of the command as a single JSON object

public void callEndpoint (String commandName, I input, KinveyListCallback callback)

Execute a Custom Endpoint which will return an array of JSON objects.

Parameters
commandName - the name of the Command to execute
input - any required input, can be null
callback - get results of the command as an array of JSON objects.