Of course. Perfect. Thanks Mark.

Yes, I was somewhat surprised when I noted that there was no doco for 
vmSafeMode.
But I'm not too worried as so far I just want the default in all scenarios 
except for V9 and V9 instances aren't going to lose than behaviour now.

William


On Friday, March 16, 2012 9:25:57 PM UTC+10, Mark Murphy (a Commons Guy) 
wrote:
>
> On Fri, Mar 16, 2012 at 12:39 AM, William Ferguson
> > I seem to have several devices running foul of the JIT compiler in
> > Froyo (see http://code.google.com/p/android/issues/detail?id=9281)
> > The solution appears to be setting android:vmSafeMode="true" in my
> > application element in the Manifest, and this seems to work well.
>
> Note that this is a lightly-documented property on <application>, so
> I'd keep a very close eye on future Android releases so make sure they
> don't get rid of it, rename it, etc.
>
> > But I don't really want to switch off JIT for everyone, just for the
> > FROYO users.
> > Does anyone know of a way to set vmSafeMode at runtime?
>
> Create a boolean resource (e.g., @bool/safeModeEnabled). Define it in
> res/values/ as true. Define it in res/values-v9/ as false. Use the
> resource as the value of android:vmSafeMode. Then, at runtime, Android
> will use the right value for the device. Technically, this uses safe
> mode for API Level 8 *and lower*, but since I think JIT only showed up
> in API Level 8, I doubt there will be an impact on lower API levels.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
>

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

Reply via email to