Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i detect any version in my app?

Tags:

java

android

I'm create app with SDK 1.6 and i want to, if my app running in android 3 : do sth , i using these code but the error told me HONEYCOMB cannot be resolved or is not a field.

here is my code:

if (Build.VERSION.RELEASE == Build.VERSION_CODES.HONEYCOMB) {
// do anything...
} else {
// do anything...
}
like image 471
Mr.James Avatar asked Jul 02 '11 11:07

Mr.James


People also ask

How do you know what version of an app is in an app?

Open the Settings app on your Android device. Open the "Applications" and/or "Application Manager" section. Tap on your app to select it. The App Settings Panel has multiple options including App Version, Notifications, and Location.

How do you check app is updated or not?

At the top right, tap the profile icon. Tap Manage apps & device. Apps with an update available are labeled "Update available."

How do I know what version of an Android app is compatible with?

Google Play Store compares the features your app requires to the features available on each user's device to determine whether your app is compatible with each device. If the device does not provide all the features your app requires, the user cannot install your app.


1 Answers

For Build.VERSION_CODES.HONEYCOMB to be recognized at compile time, you will need to have your build target set to API Level 11 or higher. In Eclipse, this is in the Android section of your project properties; for command-line builds, this is in default.properties.

like image 150
CommonsWare Avatar answered Oct 06 '22 00:10

CommonsWare