Как прочитать ответ php-кода на javas-код андроид

У меня есть php-код, запущенный на сервере Wamp, который возвращает все содержимое базы данных в виде массива JSON. Я хочу подключить свое приложение для Android к этому файлу php. Как получить ответ этого php-файла на мой javas-код для Android.

MY PHP CODE:

<?php $con = mysqli_connect("localhost","root","2015","testdatabase") or die("Error " . mysqli_error($link)); if (!$con) { die('Could not connect: ' . mysqli_error()); } $result = mysqli_query($con,"SELECT * FROM Customer"); while($row = mysqli_fetch_assoc($result)) { $output[]=$row; } print(json_encode($output)); mysqli_close($con); ?> 

Также вот что я сейчас делаю в своем коде Android (но большая часть того, что я делаю, считается устаревшей):

 public JSONArray GetAllCustomers() { // URL for getting all customers String url = "http://127.0.0.1/Customers/getAllCustomers.php"; // Get HttpResponse Object from url. // Get HttpEntity from Http Response Object HttpEntity httpEntity = null; try { DefaultHttpClient httpClient = new DefaultHttpClient(); // Default HttpClient HttpGet httpGet = new HttpGet(url); HttpResponse httpResponse = httpClient.execute(httpGet); httpEntity = httpResponse.getEntity(); } catch (ClientProtocolException e) { // Signals error in http protocol e.printStackTrace(); //Log Errors Here } catch (IOException e) { e.printStackTrace(); } // Convert HttpEntity into JSON Array JSONArray jsonArray = null; if (httpEntity != null) { try { String entityResponse = EntityUtils.toString(httpEntity); Log.e("Entity Response : ", entityResponse); jsonArray = new JSONArray(entityResponse); } catch (JSONException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return jsonArray; } }