i create a table in Mysql
database : Person(id int, Image blob).
i create a Php
script which allows me to display the image in the browser, i took the URL of this php
script and use it in android apps to show the image in an Imageview
. but now i want also to display the id of the image in a TextView
, so how can i make a script that shows the image and the id at the same time, and how can i get the data into android apps.
this is how i get just the image from my php
script:
@Override
protected ArrayList<Bitmap> doInBackground(String... params) {
String phpurl = "http://192.168.1.11/save/load_image_from_db.php?id=3";
URL url;
Bitmap image = null;
try {
url = new URL(phpurl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
image = BitmapFactory.decodeStream(connection.getInputStream());
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}