Class AerisCustomCommunicationTask
- java.lang.Object
-
- android.os.AsyncTask<Void,Void,T>
-
- com.aerisweather.aeris.communication.CommunicationTask<String>
-
- com.aerisweather.aeris.communication.AerisCustomCommunicationTask
-
public class AerisCustomCommunicationTask extends CommunicationTask<String>
Basic communication task for sending messages. Executes the AerisRequest in a background thread. This is intended for a custom endpoint. If not a custom endpoint, useAerisCommunicationTask
. The result of the message is passed back to athis callback
as JSON in string form.
-
-
Field Summary
Fields Modifier and Type Field Description protected CustomCallback
customCallback
-
Fields inherited from class com.aerisweather.aeris.communication.CommunicationTask
context, progressListener, request
-
-
Constructor Summary
Constructors Constructor Description AerisCustomCommunicationTask(android.content.Context context, AerisRequest request)
Constructs the communication task with a context to use, and a request.AerisCustomCommunicationTask(android.content.Context context, CustomCallback callback, AerisRequest request)
Constructs the communication task with a context to use, a callback and a request
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
doInBackground(Void... params)
protected void
onPostExecute(String result)
-
Methods inherited from class com.aerisweather.aeris.communication.CommunicationTask
executeSyncTask, isOnline, onCancelled, onPreExecute, unknownBatchError, unknownError, withProgress
-
-
-
-
Field Detail
-
customCallback
protected CustomCallback customCallback
-
-
Constructor Detail
-
AerisCustomCommunicationTask
public AerisCustomCommunicationTask(android.content.Context context, CustomCallback callback, AerisRequest request)
Constructs the communication task with a context to use, a callback and a request- Parameters:
context
- Context to use to check withcallback
- The callback after the communication has been executed and returned.request
- Request to use in the thread.
-
AerisCustomCommunicationTask
public AerisCustomCommunicationTask(android.content.Context context, AerisRequest request)
Constructs the communication task with a context to use, and a request. This constructor is intended to be used withCommunicationTask.executeSyncTask()
where the task is executed in a non-thread environment and the call will wait for the return object.- Parameters:
context
- Context to use to check withrequest
- Request to use in the thread.
-
-
Method Detail
-
doInBackground
protected String doInBackground(Void... params)
- Overrides:
doInBackground
in classCommunicationTask<String>
-
onPostExecute
protected void onPostExecute(String result)
- Overrides:
onPostExecute
in classCommunicationTask<String>
-
-