I've read a lot of answers about it, but sometimes they were arrays and some others were objects, here there are both together.
I have more variables of the same object stored in an array. Now i want to convert all of these to a string, so that i can send by HTTP POST request to the server and then PHP must be able to read them with JSON decode.
So that's the code Java in my Android app:
Object Class
class DataMisurati {
float valori[]=new float[3];
long tempo;
DataMisurati() { }
DataMisurati(float[] values, long temp) {
this.valori[0] = values[0];
this.valori[1] = values[1];
this.valori[2] = values[2];
this.tempo=temp;
}
}
And here some of the main code:
DataMisurati[] daticompleti;
//now i fill the array daticompleti
//here must be the code to Json the array of objects and then convert it to string
Then there must be the HTTP post with sending the string.