On 06/24/2010 04:52 PM, Mark Murphy wrote:
On Thu, Jun 24, 2010 at 4:40 PM, Raymond Rodgers
<[email protected]>  wrote:
How do you define "update the items"?
I should have been more specific, I meant ItemizedOverlays#items (the
ArrayList<OverlayItem>  member).
I should have been more specific, I am uncertain what you mean by
"update". Adding items? Removing items? Changing the snippets on
items? Addressing the tectonic shift of items??? Dealing with the
movement of items through space after aliens blast the Earth into
relatively tiny pieces, in some cosmic game of Asteroids??!??

I am guessing you were just referring to creating the ItemizedOverlay
at the outset.
If I add whatever items to the list in the constructor, when do I go through the process of adding and removing new ones based either on the currently displayed area, or from background actions such as receiving new items from the server? Although it's possible the title or a snippet on an item might change, it's far more likely that I'll need to add overlay items to what's being displayed.
It just seems to me that ItemizedOverlay should be using or have the option
to use a ContentProvider to determine which OverlayItems should be in memory
and on-screen at the time that Draw() is called.
:: shrug ::

I do not think the ItemizedOverlay was designed for thousands of
items. For smaller figures, the overhead of the ContentProvider
(particularly a possible cross-process one) may well swamp whatever
gains you think you're getting. GeoPoints are cheap objects, assuming
your snippets don't read like _War and Peace_ (or even one of my
books, which are plenty wordy). And having all the GeoPoints on hand
means the overlay can be pretty snappy on pans and zooms.

I'm one of those programmers that always tries be mindful of the amount of memory being used, and although I don't think my app is going to be a memory hog or need to have millions of points on screen at any given time, I also don't want to populate the overlay with items in Florida when the map is centered over Hawaii. It was my intention to just load the data necessary for what's currently visible to save memory and improve performance overall, but based on what you've told me, maybe I should take another approach.

In any event, thanks Mark.
Raymond

--
Raymond Rodgers
http://www.badlucksoft.com/

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to