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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:34:03+00:00 2026-06-13T19:34:03+00:00

I was going through the developer.android page for loading bitmaps efficiently, and here: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

  • 0

I was going through the developer.android page for loading bitmaps efficiently, and here: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html they talk about loading a Scaled Down Version into Memory, which is obviously very efficient.

Now my problem is that the given method requires the id of the resource, which we dont get (please correct me if I’m wrong here) while downloading images/bitmaps from the internet.

So is there any way we can use some variation of the given method for images which are downloaded from the internet ??

  • 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-13T19:34:04+00:00Added an answer on June 13, 2026 at 7:34 pm

    hey I do not know about this method but this is how I download Image from internet and save to sd card you can use this as per your requirements I use method saved to save pictures

    public class fetchImage extends Activity implements OnClickListener {
        int id;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            id = 1;// declaring static as of now
    
        }
    
        {
    
            new BackgroundTask().execute();
            File storagePath = Environment.getExternalStorageDirectory();
            File imgFile = new File(storagePath, "/Pictures/" + id + ".jpg");
    
            if (imgFile.exists()) {
                Bitmap myBitmap = BitmapFactory.decodeFile(imgFile
                        .getAbsolutePath());
            }
    
        }
    
        class BackgroundTask extends AsyncTask<Void, Void, Void> {
            ProgressDialog mDialog;
    
            protected void onPreExecute() {
                mDialog = ProgressDialog.show(fetchImage.this, "",
                        getString(R.string.progress_bar_loading), true);
            };
    
            @Override
            protected Void doInBackground(Void... params) {
                try {
    
                    savesd(id, null);
    
                } catch (final Exception e) {
    
                }
                return null;
            }
    
            private void savesd(int id, URL uri) throws IOException {
                URL url;
                if (uri == null) {
                    url = new URL("http://i.zdnet.com/blogs/3-29-androids.jpg");
                } else {
                    url = uri;
                }
                InputStream input = url.openStream();
                try {
                    File storagePath = Environment.getExternalStorageDirectory();
                    OutputStream output = new FileOutputStream(new File(
                            storagePath, "/Pictures/" + id + ".jpg"));
                    try {
                        byte[] buffer = new byte[20000];
                        int bytesRead = 0;
                        while ((bytesRead = input.read(buffer, 0, buffer.length)) >= 0) {
                            output.write(buffer, 0, bytesRead);
                        }
                    } finally {
                        output.close();
                    }
                } catch (Exception e) {
    
                    e.printStackTrace();
                } finally {
                    input.close();
                }
    
            }
    
            protected void onPostExecute(Void result) {
                mDialog.dismiss();
            };
        }
    
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going through the android developer training material here - http://developer.android.com/training/basics/network-ops/index.html . I
I am going through the Google Cloud Services tutorial here: http://developer.android.com/guide/google/gcm/gs.html And they suggest
i was just going through the documentation given on developer.android.com and when i was
Quick note: I'm using the SoundPool class http://developer.android.com/reference/android/media/SoundPool.html What I have here is a
I am going through this tutorial they have: developer.android.com/guide/market/billing/billing_integrate.html and I am in this
I'm testing out the billing sample application provided by google: http://developer.android.com/guide/market/billing/index.html Everything is going
I was going through the facebook policy instructions at http://developers.facebook.com/policy/ and section 12 (b)
I'm learning javascript and was going through an example here: https://developer.mozilla.org/en/A_re-introduction_to_JavaScript function personFullName() {
Going through the microsoft authentication tutorial listed here they have you create a master
I'm trying to get into android development and I'm going through the tutorials, however

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.