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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:57:42+00:00 2026-05-26T01:57:42+00:00

I am using this method to retrieve a bitmap private Bitmap getBitmap(String url) {

  • 0

I am using this method to retrieve a bitmap

 private Bitmap getBitmap(String url) 
{
    File f=fileCache.getFile(url);

    //from SD cache


    if(b!=null)
        return b;

    //from web
    try {
        Bitmap bitmap=null;
        Log.e("URL", url);
        URL imageUrl = new URL(url);
        HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection();
        conn.setConnectTimeout(30000);
        conn.setReadTimeout(30000);
        InputStream is=conn.getInputStream();
        OutputStream os = new FileOutputStream(f);
        Utils.CopyStream(is, os);
        os.close();

        return bitmap;
    } catch (Exception ex){
       ex.printStackTrace();
       return null;
    }
}

As you see above how do i decode the bitmap from SDcard or cache and from the get from web code? Ive tried one method but it didnt work.

  • 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-26T01:57:43+00:00Added an answer on May 26, 2026 at 1:57 am

    Well for the file part take a look here. Look specifically at decodeFile.

    As for the Url Image take a look here for a small tutorial on it.

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

Sidebar

Related Questions

I was using the java.net.URL.openStream() method to retrieve content from the server. I recently
I'm currently using this method in calling batch files in vb.net: Private Sub Button3_Click(ByVal
From the isKindOfClass: method documentation in NSObject: Be careful when using this method on
I had Repeater which bind method this method retrieve data from data base by
I'm using JQuery's getJSON method to retrieve some data from an MVC controller. [AcceptVerbs(HttpVerbs.Get)]
I'm using this simple code to retrieve a value from a PHP script: package
I am using the Tweetstream gem to retrieve statuses from Twitter. This works: Tweetstream::Client.new('user',
I am trying to use ResourceBundle#getStringArray to retrieve a String[] from a properties file.
I am using jQuery's $.ajax method to retrieve some JSON from an API. Each
i am using the classLoader method to load a property file. Using this, I

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.