0

I am trying to fetch image from net and display it in imageview

My problem is that i am able to fetch image if the url is HTTP but not if url is HTTPS

I am using the following code :-

    Bitmap bitmap = null;
    InputStream in = null;        
    try {

          URL url = new URL(URL);   
          URLConnection conn = url.openConnection();
        //  HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
          conn.connect();
          in = conn.getInputStream();
        bitmap = BitmapFactory.decodeStream(in);
        in.close();
    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    return bitmap;                
abhishek
  • 1,434
  • 7
  • 39
  • 71

1 Answers1

0

I guess you need to make some handshake with https server since it is secure protocol. You may find a solution here: Https Connection Android

Community
  • 1
  • 1
ForeverNights
  • 631
  • 1
  • 7
  • 34