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. GSM stack - RRM, LAPDm


can I get access to the lower level GSM stack layers? I need to
monitor some parameters on the Radio Resource Management level. I
guess I need to have some C shared library accessed from Java
application via JNI. But I am not the Android developer and I am not
sure if and how this might be possible.



2. Retrieving Shoutcast Meta-Data from MediaPlayer not possible. Any alternative ?

Hi folks,

this is my first post. Cool to be here :)

I am developing a shoutcast client for Android with API 1.6.
The playback is working perfectly but I am not able to get the meta-
data (song / artist).

Maybe someone of you guys could give me a hint.

As the API documentation tells me there is a
MEDIA_INFO_METADATA_UPDATE value when OnInfoListener.onInfo is called
since API level 5. Unfortunately this is not helping at all because

1. There is no further informaton within the API documentation how to
actually retrieve this metadata - or I am not able to find it.

2. I am developing fot 1.6 so this MEDIA_INFO_METADATA_UPDATE is not
available to me anyway.

So to me the only alternative seems to read the shoutcast stream
manually and use the buffered data with
the MediaPlayer as a DataSource. I tried that and it turned out to
work BUT I was not able to remove a little gap between buffer
playbacks because the MediaPlayer was not able to synchronize the two
data sources because there is no such mechanism implemented (I

Furthermore I know that it is possible to get this done because there
are existing shoutcast clients even for Android 1.5 available.

Does anybody know something about this issue ?



3. regarding image in menu items

4. News and Weather Standings: 11/16/2009 - 11/25/2009

5. How to call service by intents and programmatically?

6. drag and drop listview, background color & transparency broken, TouchInterceptor modification

7. Installing prebuilt apk