Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:52:19+00:00 2026-05-24T08:52:19+00:00

My goal is to download images from a google app engine server with my

  • 0

My goal is to download images from a google app engine server with my android application. I use for that an asynctask. The server is located in google app engine and the images (JPEG files) are in blobstore. First I checked whether the server is working with my google chrome browser. I could see the picture with the same URI on my browser. So my server is working fine. My connection has a session and it is a https connection. My app should download images as drawable (or bitmap?) and make an array from them and put this array into an imageadapter for a gallery. The problem is that when I do Drawable myImage = Drawable.createFromStream(is, “Image”); myImage is null. (I check this with an If (myImage==null)). Why is my browser showing the image but it is null in my code?

PS: I made a lot of search but there are lots of alternatives for downloading image from web. But I can’t understand why this isn’t working. I ran the code on android 2.2.

Here is the code:

        URI uri = new URI(URIString);

        HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;

        SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();
        socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);

        Scheme sch = new Scheme("https", socketFactory, 443);
        httpclient.getConnectionManager().getSchemeRegistry().register(sch);

        HttpGet httpget = new HttpGet(uri);

        System.out.println(httpget.getURI());

        HttpResponse response = httpclient.execute(httpget, myLibrary.localContext);

        HttpEntity entity = response.getEntity();

        InputStream is = entity.getContent();

        Drawable myImage= Drawable.createFromStream(is, "Image");
        entity.consumeContent();

        if (myImage!=null){
            System.out.println("PhotoID " + PhotoID + " is NOT null!");
            return myImage;
        } else {
            System.out.println("PhotoID " + PhotoID + " is null!");
            return null;
        }

Thanks for any idea!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:52:20+00:00Added an answer on May 24, 2026 at 8:52 am

    You should check the status of the response before attempting to parse the response entity. The HTTP status of the response is the first place to check for errors. It can be checked with response.getStatusLine().getStatusCode(). If it is not 200 then there’s a problem with your HTTP request, and that is causing your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to get all images from document, then download all images bigger
Goal: Produce an Excel document with information from 3 associated models that is similar
I have a site that I'm optimizing using Google Website Optimizer where the goal
I am working on an app that implements a custom ListView that contains images.
I'm building a private enterprise Android application. My goal is to detect when there
In my app I download images and insert them into a table view. In
How can I allow users to download pictures saved on the server? The goal
Goal : Add the latest JSON into my project. I download JSON from this
I'm making an application that reads a bunch of images URL on a JSON
My goal is simple : I am developing an Android app and want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.