Hi,
In fact donwload th page and convert it into a picture
Code:
HttpConnection connection = null;
InputStream inputStream = null;
try
{
connection = (HttpConnection) Connector.open(url, Connector.READ, true);
inputStream = connection.openInputStream();
byte[] responseData = new byte[10000];
int length = 0;
StringBuffer rawResponse = new StringBuffer();
while (-1 != (length = inputStream.read(responseData)))
{
rawResponse.append(new String(responseData, 0, length));
}
int responseCode = connection.getResponseCode();
if (responseCode != HttpConnection.HTTP_OK)
{
throw new IOException("HTTP response code: "+ responseCode);
}
final String result = rawResponse.toString();
try
{
byte[] dataArray = result.getBytes();
EncodedImage encodedimage = EncodedImage.createEncodedImage(dataArray , 0 , dataArray.length);
return encodedimage;
}
catch (final Exception e)
{
return null;
}
}
catch (Exception e)
{
return null;
}