I have improved the responsiveness using some of MyTrack approaches,
but i am still getting this exception, simply doing zoom in and zoom
out sometimes....
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:574)
at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:
444)
at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:151)
at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:140)
at com.google.android.maps.MapView.doZoom(MapView.java:1478)
at com.google.android.maps.MapView.doZoom(MapView.java:1487)
at com.google.android.maps.MapView$6.onZoom(MapView.java:1442)
at android.widget.ZoomButtonsController
$3.onClick(ZoomButtonsController.java:268)
at android.view.View.performClick(View.java:2408)
at android.view.View$PerformClick.run(View.java:8817)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
On 1 jul, 15:49, JP <[email protected]> wrote:
> You could conceivably use a change in zoom level to drive the thinning
> of the poly lines, or other factors that help you determine the level
> of thinning. This is not trivial - you'll want to run the algorithm
> outside of your Overlay.draw() and probably not draw any lines until
> the algorithm has finished. Off the cuff, I figure you'll have to use
> AsyncTask for that, so there's not quick and dirty way (that I can
> see) if you want to get this right. In any case, you could study
> MyTracks to find out how they've solved this problem.
>
> On Jul 1, 2:00 am, Felix Garcia Lainez <[email protected]>
> wrote:
>
>
>
> > Hi,
>
> > So you are doing something similar to my draw method?
>
> > I have just tested without alpha and anti-alising and it is faster,
> > but when there is big zoom level the mapactivity is closed (i think
> > this is due to memory usage)
>
> > How should i profile this case? Really as i said there is not any
> > strange thing on the code... Simply a map with an overlay...
>
> > Thanks!
>
> > On 1 jul, 01:39, TreKing <[email protected]> wrote:
>
> > > On Thu, Jun 30, 2011 at 5:47 PM, Felix Garcia Lainez <
>
> > > [email protected]> wrote:
> > > > About the size with 300 or 400 GeoPoints i am already having problems...
> > > > The method isOnePointVisible is an optimization i did in order to try to
> > > > improve performance (seems to work fine).
>
> > > So I have a very similar overlay to draw routes, with no optimization,
> > > and I
> > > just loaded 7 or 8 of them with no apparent slow down on my Nexus One.
>
> > > Here are some thoughts:
> > > - What device are you running on?
> > > - Are you debugging or is this in release mode?
> > > - Do you need anti-aliasing? I think that might slow it down.
> > > - Do you need alpha? That would definitely slow down drawing. Set that to
> > > solid and see if if helps.
>
> > > If none of that helps you're going to have to profile your code to get a
> > > clear picture of what's taking so long.
>
> > > ---------------------------------------------------------------------------
> > > ----------------------
> > > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > > transit tracking app for Android-powered devices
--
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