Try;

import android.os.Build.VERSION;

.
.
.
.

if(VERSION.SDK.equals("3")){

      // Do firmware 1.5/Cupcake stuff

} else if(VERSION.SDK.equals("2")) {

      // Do firmware 1.1 stuff

} else if(VERSION.SDK.equals("1")) {

      // Do firmware 1.0 stuff

} else {

      // Do anything you think will be compatible with future firmware versions

}

---

* Written an Android App? - List it at http://andappstore.com/ *

======
Funky Android Limited is registered in England & Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of ???
Sent: 19 May 2009 07:47
To: android-developers@googlegroups.com
Subject: [android-developers] Re: How can I get current SDK version in my 
program code ?

Hi Dianne,
Thanks for your response,but I still don't get it.
I try to use System.getProperty("android.os.Build.VERSION.SDK"))
and new a android.os.Build object, but those ways still can't get sdk version.
Can you tell me how to get sdk version by using android.os.Build.VERSION.SDK?

thank you very much

2009/5/19 Dianne Hackborn <hack...@android.com<mailto:hack...@android.com>>
android.os.Build.VERSION.SDK.

On Mon, May 18, 2009 at 10:30 PM, aby 
<orz0...@gmail.com<mailto:orz0...@gmail.com>> wrote:

Hi,
Can I get current SDK version (like 1.0 or 1.5)in the program code?
I  try to use the PackageInfo way like:
http://groups.google.com/group/android-developers/browse_thread/thread/2512093fd268e1d/774a0f0c30bd05a3?lnk=gst&q=to+goet+sdk#774a0f0c30bd05a3

but it only can supply my application version.

Thanks



--
Dianne Hackborn
Android framework engineer
hack...@android.com<mailto:hack...@android.com>

Note: please don't send private questions to me, as I don't have time to 
provide private support, and so won't reply to such e-mails.  All such 
questions should be posted on public forums, where I and others can see and 
answer them.






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