Yes, though the actual syntax will be something more like:

if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB {
    // do something Android 3.0+
}

referencing the android.os.Build class.

Also note that this will only work on Android 2.0 and higher --
Android 1.x support is possible but more complicated.

On Mon, Jan 7, 2013 at 4:11 PM, dashman <[email protected]> wrote:
> I'd like to use an android sdk interface that's available only
> in android v3.0 or later.
>
> i'd like to maintain compatibility with earlier platforms.
>
> i thought about reflection - but interface reflection does not seem
> to work. can i do this.
>
> if ( SYSTEM_PLATFORM >= 3.0 )
> {
>     // then directly reference the android v3.0 interface
>
> }
>
>
> meaning on a pre android v3.0 - there'll be a compile time reference
> to the interface - but not runtime.
>
>
> will this work?
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.5 Available!

-- 
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