I have some html and javascript code running on a WIFI module that runs a webserver. At a certain point, a jquery ajax call is done like so:
reqData = JSON.stringify({FileName: L_JSON_FILENAME, CmdArr: [["read", "cmduart", "data"]]});
jQuery.ajax('' + _szFileRequest,
{
data: reqData,
dataType: 'json',
contentType: "application/json",
async: false,
type: 'POST',
success: function (data, textStatus, jqXHR) {
ReturnedColumn = handleData(data, textStatus, jqXHR);
},
error: function (jqXHR, textStatus, errorThrown)
{
ReturnedColumn = "error";
}
});
Now I want to do the same thing on an android app.
I am currently working in Android Studio.
I have read something about a JSONobject and using toString. But I have also read about using AsyncHttpClient and using RequestParams.
What is the best way to accomplish this call?