Package android.os.Build not found

Hi all,

I’m trying to get this code working:
[java]if (android.os.Build.VERSION.SDK_INT<android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {[/java]

, but I get an error that the package android.os.Build does not exitst. When I manually include android.jar the build process says that android.jar is already included. NB Android is installed.

Do you know how to solve this ?

Thanks in advance.

You can’t do that on the JME side, you don’t have any android references.

What you can do though is have a androidVersion attribute in your app with accessors and in the onCreate of your mainActivity go with app.setAndroidVersion(android.os.Build.VERSION.SDK_INT)
then use this attribute on the JME side.

don’t forget to call the super.onCreate() though.

@nehon : Thanks for your answer. I’m going to implement it that way.