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

  • Home
  • SEARCH
  • 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 9073447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:25:10+00:00 2026-06-16T18:25:10+00:00

right now I am retrieving images using following piece of code and it is

  • 0

right now I am retrieving images using following piece of code and it is working perfectly.but I want to implement cache using universal-image-loader.I have already implemented it in my other projects in which I was having complete url of image like ~\images\pic1.jpeg .on the other hand,while using Contacts api v3 I have to deal with input streams and I don’t have such complete url.so I don’t know how to implement universal-image-loader.

for the reference:Contact api v3

here is the code which I am using right now:

    Bitmap bm=BitmapFactory.decodeResource(HomeActivity.this.getResources(),
            R.drawable.profile_pic);
    CONSTANTS.buffer = new byte[4096];

// iterate the loop upto number of contacts
    for(int i=0;i<CONSTANTS.contactArrayList.size();i++)
    {


//if the contact has any profile pic then retrieve it otherwise set default profile pic from drawable folder

    if(CONSTANTS.contactArrayList.get(i).getContactPhotoLink().getEtag()!=null)
        {
            try
            {
                GDataRequest request = CONSTANTS.mContactService.createLinkQueryRequest(CONSTANTS.contactArrayList.get(i).getContactPhotoLink());
                  request.execute();
                  InputStream in = request.getResponseStream();
                  CONSTANTS.buffer = ByteStreams.toByteArray(in);
                  bm = BitmapFactory.decodeByteArray(CONSTANTS.buffer, 0, CONSTANTS.buffer.length);
                  in.close();
                  request.end();
            }
            catch (Exception e) {
                UTILS.Log_e("loadProfilePics error", e.toString());
            }

        }
        else
        {
            bm = BitmapFactory.decodeResource(HomeActivity.this.getResources(),
                    R.drawable.profile_pic);
        }
         CONSTANTS.contactArrayList.get(i).setContactPhoto(bm);
     }
  • 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-16T18:25:11+00:00Added an answer on June 16, 2026 at 6:25 pm

    Yes, universal-image-loader allows you to do it. Just follow this steps:

    1. You can introduce your own url type, for example contacts-api-v3://user_id=<user_id>
    2. Provide a way to retrieve InputStream for such urls:

      public class CustomImageDownloader extends URLConnectionImageDownloader {
          @Override
          protected InputStream getStreamFromOtherSource(URI imageUri) throws IOException {
              if (imageUri.getScheme().equals("contacts-api-v3")) {
                  // here you can use code provided in your question
                  return retriveInputStreamForThisUser();
              }
              return null;
          }
      }
      
    3. Configure ImageLoader to use your CustomImageDownloader:

      final ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(context);
      
      // some basic configuration should be here
      
      builder.imageDownloader(new CustomImageDownloader());
      
    4. Now you can use it this way:

      ImageLoader.getInstance().displayImage("contacts-api-v3://user_id=123", imageView);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I am using sqlite within a ios application, and I want to
I am working on a project for an RSS Client. Right now I'm retrieving
Right now I am using this code to retrieve the MAC Address of a
We have a flash retrieving information from an XML file. Right now we are
Right now, I've just some code which fetches the picture from the URL directly.
Well I have 2 issues but my main concern right now is my catch
Right now I am using Oracle utility procedure, UTL_COMPRESS.LZ_COMPRESS() , to compress some data.
I'm parsing a JSON file that I'm retrieving by accessing an API. Right now,
Right now a lot of my applications use GWT-RPC for retrieving POJO's from a
In the following code for retrieving data via a SQL query from the db,

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.