Question on memory management in android

by Anton S. » Wed, 05 Jan 2011 03:01:52 GMT


Sponsored Links
 Hi,
I have a single image that is slightly larger than the android screen
which I load into a ScrollView.

My question is the following:

Does android load the entire image into memory even though parts of it
are invisible(need to be scrolled to),
or does it use some kind of external/internal cache to store parts of
the image that are not
currently visible? If not, do you think it would be possible to
implement something like this.

Thanks!!

-- 



Re: Question on memory management in android

by Doug » Thu, 06 Jan 2011 08:51:12 GMT


 Bitmaps are going to take as much memory as they need for the grid of
pixels they represent.  If you want to store a giant image into a
giant bitmap (or even if you just want to create a giant empty bitmap)
you will consume that memory.

Android doesn't do so well with giant bitmaps that come and go because
they don't get garbage collected in the way you'd expect, and you'll
often run into memory problems if you attempt this.  It's a really
hairy topic with a lot of prior conversation around it that you can
easily search and find.

Doug




-- 


Sponsored Links


Re: Re: Question on memory management in android

by Anton S » Fri, 07 Jan 2011 02:32:30 GMT


 Alright, so that means it does load the entire image into memory.

I guess I'll try to break up my image and only load parts of it as they are
needed.


Thanks for you input Doug!






-- 



Other Threads

1. Hero ROM Androlib.net based official WWE HTC

berhubung lagi gak ada kerjaan. dan pengen mendalami belajar android. ini
custom ROM pertama based pada official Hero WWE. masih banyak kekurangan
sepertinya. dan malem ini atau besok saya akan update lagi.

Features
    * tweaking memory dengan setingan MemFree manager
    * Wireless Tether
    * Official Eclair 2.1
    * ChainsDD Superuser 2.1
    * 3D Gallery
    * STK
    * init.d folder support
    * Automatic Apps2SD
    * AdFree
    * No Boot Sounds

sory belum sempet ngecek hash MD5nya. silakan yang mau coba,
menyusul overclock kernelnya ntar di link ya..
dalam bentuk update zip.

download
http://www.androlib.net/forum/index.php?topic=111.0

menyusul previewnya jg.. HHnya lagi dipake

-- 
Indosat Broadband + Heroic Android

im www.androlib.net team
Android Library Forum

-- 
"Indonesian Android Community [id-android]" 

2. Android Mp3 Intent: Shazam does it, how do we?

Is this a private Intent now or what? This used to work. I debugged
and found amazon changed the package name. All good, but now you can't
launch the Search Activity directly (permission denied)

So, here's what Shazam is doing,b ut I can't quite figure out how they
are adding extra's or something to the intent to get it to proxy and
then load the search?

So, I can call the EXTERNAL_EVENT, and this will load a blank Amazon
MP3 app...(or I can call  HomeActivty and that just loads the app, but
I'd like to put a search artist in there).


Anyone?

(Btw, is Google censoring/deleting questions regarding this App? I've
posted another one and it is now removed).

You'd think Amazon would want us who are writing music apps to direct
our users to them...

/WindowManager( 2264): Dsptch 1 x166.0 y570.0 > Window{47b52780
com.shazam.android/com.shazam.android.TagTrackDetail paused=false}
I/ActivityManager( 2264): Starting activity: Intent
{ act=com.amazon.mp3.action.EXTERNAL_EVENT
cmp=com.amazon.mp3/.client.activity.IntentProxyActivity (has extras) }
D/PhoneWindow(11982): couldn't save which view has focus because the
focused view com.shazam.android.tagtrackdetailv...@47b4ba90 has no id.
D/dalvikvm(11982): threadid=39 wakeup: interrupted
I/ActivityManager( 2264): Start proc com.amazon.mp3 for activity
com.amazon.mp3/.client.activity.IntentProxyActivity: pid=12022
uid=10029 gids={3003, 1015}
W/InputManagerService( 2264): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub
$pr...@47a8b320
I/Zygote  (12022): Zygote: pid 12022 has INTERNET permission, then set
capability for CAP_NET_RAW(13)
I/dalvikvm(12022): De{*filter*} thread not active, ignoring DDM send
(t=0x41504e4d l=38)
I/dalvikvm(12022): De{*filter*} thread not active, ignoring DDM send
(t=0x41504e4d l=32)
I/ActivityThread(12022): Publishing provider
com.amazon.mp3.client.SearchSuggestionProvider:
com.amazon.mp3.client.SearchSuggestionProvider
V/WifiProgressStore(12022): WifiProgressStore Created
D/Configuration(12022): active site = local
I/System.out(12022): interface name: null
D/dalvikvm(12022): GC freed 3204 objects / 285096 bytes in 184ms
I/ActivityManager( 2264): Starting activity: Intent
{ act=android.intent.action.SEARCH flg=0x14000000
cmp=com.amazon.mp3/.client.activity.SearchActivity (has extras) }

-- 

3. Solution to whining users over advertising

4. Android-based Laptop + need to run Win XP apps

5. WTPamer: Homescreen hari ini

6. Homescreen g

7. Link belajar desire