I want to POST an android array (or list) to a php page and then insert all element of the array in a mysql table. I'm using the AsyncHttpClient library.
Now I'm using this code:
RequestParams params = new RequestParams();
for ( String element: elements) {
params.add("elements[]", element);
}
AsyncHttpClient client = new AsyncHttpClient();
client.post(context, "https://aaaaa.php", params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] response) {
try {
//mycode
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
}
});
But I don't know if it is the correct method. How I can get my android array in a php page?