I am currently working on project. It involves reading data from cloud server continuously. I am using ubidots server. Currently i have created class that extends to asynctask class like this
public class ApiUbidots extends AsyncTask<Integer, Void, Void> {
private final String API_KEY = "1XXXXXXXXX";
private static final String tempID = "56XXXXXXXX";
@Override
protected Void doInBackground(Integer... params) {
final ApiClient apiClient = new ApiClient(API_KEY);
Variable tempVariable = apiClient.getVariable(tempID);
Value[] tempValues = tempVariable.getValues();
Double vlStr = tempValues[0].getValue();
String tempValue = String.valueOf(vlStr);
Log.i(TAG, "TEMPERATURE VALUE IS ====" + tempValue);
tempTextView.setText(tempValue);
return null;
}
}
now i am trying to set the values i got from server to display on textview but i cannot set in this class.
I need to find a way where the textview have to be changed whenever the data variable changes
Can anyone please help me how to proceed to get it working. Thank you!