runtime API level detection

by » Tue, 28 Apr 2009 10:58:34 GMT

Sponsored Links
 I'm trying to product a binary that is compatible with 1.1 and 1.5,
but i'm having trouble with the ViewSwitcher class behaving
different.  I'd like to create a wrapper for it, but I need a way to
programatically detect the api level at runtime.


runtime API level detection

by fadden » Wed, 29 Apr 2009 04:26:47 GMT

 On Apr 27, 7:58pm, "" <>

Some thoughts on wrappers: 

It doesn't really help if you're seeing different behavior from
existing classes/methods, because the behavior of public APIs isn't
supposed to change across revisions.  Is this something you can test
for at runtime by executing ViewSwitcher code?  (It's better to go by
"has behavior X" than "is version Y" so that your code automatically
does the right thing in future releases.)


Sponsored Links

runtime API level detection

by Tom Gibara » Wed, 29 Apr 2009 04:35:55 GMT

 I think you should be able to use android.os.Build.VERSION.SDK though I
haven't needed to use it myself yet.
This thread might also be useful:

Other Threads

1. what is problem with my library project

Hi all,

I have created a library project. When I use the library project in
other project, it compiles. How ever, when I run the application, it
always get the error "The application has stopped unexpectly.".

Have anyone has the same experinece?




2. Accessibility program

Hi everyone

I'm mainly a PHP developer, and have only basic Java experience, but I
recently acquired an Android phone (A HTC Desire) and was shocked to
discover how poor the out-of-the-box accessibility features are!  I
had naturally assumed that there would be something along the lines of
the full screen zoom features in more recent versions of iPhone OS,
but there isn't.  In fact, out of the box there's no accessibility
features at all, not even the option to set a system-wide font size!

So this was my motivation for starting to investigate Android
programming, I want to start implementing some kind of full screen
zoom like the iPhone has.  I also had an idea for a simpler project to
turn the phone into a magnifier (turn the camera on, lock its focal
length to the shortest distance and turn the flash on).

I think the phone-as-magnifier app is probably something that would
make a good beginners project, so that's what I'm going to try

As for the full screen magnifier app, I'm not sure if this is
possible, or how to go about implementing it if it is.  It basically
needs to be able to overlay any other app and allow the view of that
app to be zoomed.  Could something like this be done with the provided
APIs in Android 2.1, or would it have to be baked into the OS itself?


3. Motorola Devou

4. Debug Keystore Password Wrong? HELP!!!

5. GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX

6. Uploading files on servlet

7. Acara Indosat di Pontianak mengenai Androi