[android-developers] Re: Writing Version-Specific Code

2011-04-13 Thread lbendlin
Here is an example for a custom audio manager that supports ducking (or not) package com.pocketgpsworld.cameralert; import android.content.Context; import android.media.AudioManager; import android.media.AudioManager.OnAudioFocusChangeListener; import android.os.Build; public abstract

[android-developers] Re: Writing Version-Specific Code

2011-04-13 Thread lbendlin
Here's an example of a custom audiomanager that supports ducking, but only for the newer OS versions package xyz; import android.content.Context; import android.media.AudioManager; import android.media.AudioManager.OnAudioFocusChangeListener; import android.os.Build; public abstract

Re: [android-developers] Re: Writing Version-Specific Code

2011-04-13 Thread Mark Murphy
On Tue, Apr 12, 2011 at 11:12 PM, Jake Colman col...@ppllc.com wrote: Can you provide an example? https://github.com/commonsguy/cw-android/tree/master/Menus/ActionBarBC https://github.com/commonsguy/cw-android/tree/master/Prefs/FragmentsBC

[android-developers] Re: Writing Version-Specific Code

2011-04-13 Thread Andy
http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html On Apr 12, 4:01 pm, Jake Colman col...@ppllc.com wrote: My application is targeted for v1.6 and greater.  There is, however, one feature that I'd like to implement that would work only on v2.2.  How

[android-developers] Re: Writing Version-Specific Code

2011-04-13 Thread Don
Here's a good writeup on how to do this. http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html The benefit of doing it this way vs leaving the min/target SDK at the lowest level and using reflection is that by setting the target SDK to the higher level you

[android-developers] Re: Writing Version-Specific Code

2011-04-12 Thread Jake Colman
MM == Mark Murphy mmur...@commonsware.com writes: MM On Tue, Apr 12, 2011 at 5:08 PM, lbendlin l...@bendlin.us wrote: It was also factually wrong, according to the all-knowing source of all wisdom (aka Wipikedia) Basically, use reflection to hide the new function from the