Images not displaying in gridview for API Level 17
<p>I am displaying images from a <code>php server</code> to <code>gridview</code>. The images are displaying on devices when the API level is below <code>10</code> but I want to display the images on devices from API level <code>8</code> to <code>17</code></p>

<p>My code is </p>

<pre><code>try {
    myFileUrl = new URL(fileUrl);
    conn = (HttpURLConnection) myFileUrl.openConnection();

    conn.setDoInput(true);
    conn.connect();

    int length = conn.getContentLength();
    is = (InputStream) conn.getInputStream();

    //Decode image size

    BitmapFactory.Options o = new BitmapFactory.Options();
    o.inJustDecodeBounds = true;
    BitmapFactory.decodeStream(conn.getInputStream(),null,o);

    //The new size we want to scale to
    final int REQUIRED_WIDTH=WIDTH;
    final int REQUIRED_HIGHT=HIGHT;

    //Find the correct scale value. It should be the power of 2.
    int scale=1;
    while(o.outWidth/scale/2&gt;=REQUIRED_WIDTH &amp;&amp; o.outHeight/scale/2&gt;=REQUIRED_HIGHT)
        scale*=2;

    //Decode with inSampleSize
    BitmapFactory.Options o2 = new BitmapFactory.Options();
    o2.inSampleSize=scale;
    Bitmap img = BitmapFactory.decodeStream(conn.getInputStream(), null, o2);
    is.close();
</code></pre>
