title: How to get an Image file from PHP and show in Android?
body: <p>I want to get the image file from php. In my case I tried to convert image into BLOB first then cast it back after I get it from JSONObject. It says in Logcat that JSONObject can not be cast to java.sql.Blob.</p>
  
  <p>If there is another way please tell.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>            JSONArray array = new JSONArray(getJSONUrl(url));
              for (int i = 0; i &lt; products.length(); i++) {
                  JSONObject jsonObj = products.getJSONObject(i);
  
                  placeName = jsonObj.getString(TAG_PlaceName);
                  placeDesc = jsonObj.getString(TAG_PlaceDesc);
                  placeID = jsonObj.getString(TAG_PlaceID);
                  try {
                      Blob blob = (Blob) jsonObj.get(TAG_placeIcon);
                      byte[] byteBlob = blob.getBytes(0,
                                     (int) blob.length());
                      Bitmap bmp = BitmapFactory.decodeByteArray(byteBlob, 0,
                                 byteBlob.length);
                      rowItems.add(new RowItem(placeID,placeName,placeDesc,bmp));
                  } catch (SQLException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
  </code></pre>