java.lang.Object | ||
↳ | com.kinvey.java.CustomEndpoints<I extends com.google.api.client.json.GenericJson, O extends com.google.api.client.json.GenericJson> | |
↳ | com.kinvey.android.AsyncCustomEndpoints<I extends com.google.api.client.json.GenericJson, O extends com.google.api.client.json.GenericJson> |
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.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructor for this Asyncronous Custom Endpoint class
Constructor for this Asyncronous Custom Endpoint class
responseClass | the class of the expected resposne object |
---|---|
client | an active logged in client |
Execute a Custom Endpoint which will return a single JSON object
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 |
Execute a Custom Endpoint which will return an array of JSON objects.
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. |