How to Capture and Set a Webpage as Live WallPapaer within Wallpaper Service And Engine
<p>I want to capture a web page from any website like "www.google.com" and then i want to convert that web page in a bitmap image and then set that bitmap image like "google.jpeg" as live wallpaper..
please help me..</p>

<p>i have tried to get input stream of a web page and then i want to convert it in bitmap and save in sdcard or if it will directly convert in bitmap then it is the best..</p>

<p>my code is</p>

<pre><code>public Bitmap getRemoteDataMain(URL aURL) { 

    try { 

      URLConnection connection = aURL.openConnection(); 
      connection.connect();         
      BufferedInputStream bis = new BufferedInputStream(connection.getInputStream()); 

      Bitmap bm = Bitmap.createBitmap( 200,200, Bitmap.Config.ARGB_8888);

      ByteArrayBuffer baf = new ByteArrayBuffer(bis.available());
      int current = 0;
      while ((current = bis.read()) != -1) {
            baf.append((byte) current);
            Log.v("3 BAF " + baf ,"BAF");
      }

      FileOutputStream fos = new FileOutputStream("/sdcard/image.jpeg");
      fos.write(baf.toByteArray());

      bm.compress(Bitmap.CompressFormat.JPEG, 90, fos );
      bm = BitmapFactory.decodeStream(bis); 

      bis.close(); 
      return bm;

    } catch (IOException e) {
      return null; 
    }
}
</code></pre>
