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 8918971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:53:16+00:00 2026-06-15T05:53:16+00:00

I am using the universal image loader in an app that needs to fetch

  • 0

I am using the universal image loader in an app that needs to fetch images an authorized source.

So far, I have extended the URLConnectionImageDownloader class with my own class, and overridden the method getStreamFromNetwork with my own implemetation that sets the authorization header in the URLConnection object as such:

public class authURLConnectionImageDownloader extends URLConnectionImageDownloader {

@Override
public InputStream getStreamFromNetwork(URI imageUri) throws IOException {

    String auth = Base64.encodeToString(("username" + ":"+"psswd").getBytes(), Base64.NO_WRAP);

    URLConnection conn = imageUri.toURL().openConnection();
    conn.setRequestProperty("Authorization", "Basic " + auth);

    conn.setConnectTimeout(DEFAULT_HTTP_CONNECT_TIMEOUT);
    conn.setReadTimeout(DEFAULT_HTTP_READ_TIMEOUT);

    return new FlushedInputStream(new BufferedInputStream(conn.getInputStream(), BUFFER_SIZE));     
}

and for setting up my ImageLoader…

imageLoader = ImageLoader.getInstance();

ImageLoaderConfiguration config =  new ImageLoaderConfiguration.Builder(MainActivity.this)
        .imageDownloader(new authURLConnectionImageDownloader())
        .build();

imageLoader.init(config);

So far I have unable to get it to work. The image is not downloaded. But more importantly I have put a breakpoint in getStreamFromNetwork() and it is never hit? What am I doing wrong?

  • 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-06-15T05:53:19+00:00Added an answer on June 15, 2026 at 5:53 am

    I managed to get it working in the end…

    I used the library .jar with source that comes with the example, and debugged it. I saw that it was never accessing my URLConnectionImageDownloader derived class and always using the parent.

    So looked at my code, and saw I was setting up another imageloader within a previous activity that was using the default URLConnectionImageDownloader class.

    Now I have created an application class and setup my ImageLoader once (as in the example app), and set the config to use my new authURLConnectionImageDownloader class. Now all my activies use this ImageLoader and it works.

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

Sidebar

Related Questions

I am creating a universal ios 2D game using cocos2d. I have few images
In my universal app, I am setting an image on navigation bar...using ** objective
I'm using the Universal Image Loader from nostra13 at https://github.com/nostra13/Android-Universal-Image-Loader . My problem is:
I have developed the universal app using xcode 4.2. It is the time to
I have written a universal app that's working fine on both iPhone (iPod Touch)
I'm testing both LazyList (LL) and Universal Image Loader (UIL) that I found here
I am using APNS service in my universal app (iPhone/iPad) and i am not
I have a question about using HTTPS in a JBossAS7 web application (a universal
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I am making a Universal app on xCode 4.4, using Storyboards. I am making

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.