I am working on an android app and I am using php/doctrine to retrive the data from the database. I put said data in a json object.
The problem is that I do not know how to display it on the android. This is the php code:
function getTransaction($id) {
$transaction = $this->getDoctrine()
->getRepository('nameBundle:Transaction')
->find($id);
if(!$transaction) {
throw $this->createNotFoundException('No transaction found'.$id);
}
$array = $transaction->toArray();
$json = json_encode($array);
}
Please follow this simple tutorial here
You have to get first the request httpPost of the server.
And then parse the json object.
More details Check this Read Json From url