Rreading an image from outside webservice to android application

  • Replies:0
Srinivas Android
  • Forum posts: 1

Sep 7, 2012, 7:57:15 AM via Website

Hi,

My queries are
1. How to read an image from outside WCF REST service to android application.
2.Which is the best format of "base64" or "binary" for android(JSONObject) to read them quickly?
3.Which is the best & fast method in android to read image from outside WCF REST service?
4. How to do buffering in android?

I need to display an image in android application. The image is stored in database in another location.
In WCF RESTservice, first I am reading an image from database & converting that image in to base64 format and
then I am sending that image in JSON format to Android app.

But, JSONObject is not able to read that Base64 image.It is giving Error.
Error : "Undetermined character at .....".



The Android code is............
========================================================================================
Reader DetailsReader = new InputStreamReader(response.getEntity().getContent());
//create a buffer to fill if from reader
char[] buffer = new char[(int) response.getEntity().getContentLength()];

//fill the buffer by the help of reader
DetailsReader.read(buffer);
//close the reader streams
DetailsReader.close();


JSONObject Details = new JSONObject(new String(buffer));

========================================================================================

Reply