Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>String url = "https://graph.facebook.com/100003506521332/picture"; try { bitmap = globleDeclaration.getLiveImage(url, 50, 50); bitmapField.setBitmap(bitmap); } catch (IOException e) { e.printStackTrace(); Dialog.alert(e.getMessage()); } public Bitmap getLiveImage(String url,int width,int height) throws IOException { Bitmap bitmap = null; try { byte[] responseData = new byte[10000]; int length = 0; StringBuffer rawResponse = new StringBuffer(); httpconnection = (HttpConnection) Connector.open(url, Connector.READ, true); String location=httpconnection.getHeaderField("location"); if(location!=null){ httpconnection = (HttpConnection) Connector.open(location, Connector.READ, true); }else{ httpconnection = (HttpConnection) Connector.open(url, Connector.READ, true); } inputStream = httpconnection.openInputStream(); while (-1 != (length = inputStream.read(responseData))) { rawResponse.append(new String(responseData, 0, length)); } int responseCode = httpconnection.getResponseCode(); if (responseCode != HttpConnection.HTTP_OK) { throw new IOException("HTTP response code: " + responseCode); } final String result = rawResponse.toString(); byte[] dataArray = result.getBytes(); encodeImageBitmap = EncodedImage.createEncodedImage(dataArray, 0, dataArray.length); } catch (final Exception ex) { System.out.print("Exception (" + ex.getClass() + "): " + ex.getMessage()); } finally { try { inputStream.close(); inputStream = null; httpconnection.close(); httpconnection = null; } catch(Exception e){} } return bitmap; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload