I've added about 35 images to my res/drawable folder and another 30 sound files to res/raw folder. Now my application takes a good 5 seconds longer to start even tough only 1 image and 1 sound resource is used for the startup screen. That makes me ask: When are my image resources loaded into memory?
Are they loaded when the application starts or when I use them for the first time? (Ex: when I call ImageView.setImageResource(myResId);)
If they are all loaded when the app starts, how can I avoid this? If each one is loaded on demand, why is my application taking longer to start?
Info about app for insight: Single activity with a ViewPager. Each view page uses one of the image resources which is a jpeg file with 700x400 px resolution (~50K) and one of the sound files which is an mp3 file <5 sec (~60K).
1. Check memory through settings. Most android phones let the user monitor the state of memory consumption using memory options in the settings. This option might be named memory or RAM. All you need to do is tap the option to view a breakdown of which processes and applications are occupying the memory.
Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, animation instructions, and more. You should always externalize app resources such as images and strings from your code, so that you can maintain them independently.
Are they bitmaps? I found this in the android dev website:
http://developer.android.com/training/displaying-bitmaps/process-bitmap.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With