Loading the same Bitmap multiple times on Android

by Unai Orbe » Thu, 29 Oct 2009 14:42:10 GMT

Sponsored Links
 Hi, I'm pretty new with Android and I have a doubt about how the resource
loading works.

I'm trying to make a game drawing directly on canvas, and I'm loading the
bitmaps using "BitmapFactory.decodeResource(mResources,
R.drawable.my_image)", my doubt is about the way Android stores/loads these.
I'm going to have to load the same image a few times, so I think I need a
"ResourceManager" for my game, but the R class is confusing me.

When I call the "decodeResource", Android has to actually load the image in
memory or it just gives me a "pointer" to the first image it loaded (when
loading the same image twice or more)? I know I could try checking the
memory it takes when loading the same image lots of times, but I'm just
feeling lazy for that :-P

Thanks in advance.


Other Threads

1. Animation List View Help!!!!

Hi all,

Anyone has idea how to create animation from top to bottom for List View
with increasing the height of each list item view ?

Any Idea please share with us.



2. Recommendations for Android app development and test hardware

I looking for recommendations for what people are using to get
access to development hardware for developing and testing Android
Apps. I see three choices that make sense:

1.      Buy Nexus One devices off contract from Google developer program
2.      Buy used or new off contract devices from Ebay or other sellers
3.      Buy devices from carriers with contract and carrier discount

We have a small number of Nexus One wee purchased and some
developers have their own Android phones from carriers, but I was
hoping to hear ideas from others. What are you doing to get real
hardware for development and testing? we have some application
features that don't test well under the emulator, so we need real

What do people think the benefits and drawbacks are for different
devices? Have people had good or bad experiences with these choices?
Anyone have any great ideas to save money buying devices? Any horror
stories of things gone wrong and that should be avoided? Are there
carrier offered devices that do not lend themselves to app development
because they are locked down in some way?

I am also concerned about QA coverage. I see posts like
http://blog.tweetdeck.com/android-ecosystem and I wonder do you do QA
on various devices? Is there a small set of devices could give you
better test coverage?

Any feedback appreciated.


3. Accessibility with ImageViews, custom views

4. How can I get the the soft keyboad render information ?

5. Wrong latitude/longitude points received by Emulator with new version of Android SDK

6. isUserAMonkey bug (and workaround) documented as issue 12166

7. java.util.Date vs android.text.format.Time