Which versions of Android SDK support coding in which versions of Java?

前端 未结 1 1406

I was writing an Android app for Android SDK 2.3.3 but then I was asked to test it on a device running Android 2.2.1. So I set my target to 8 instead of 10. But then java.

相关标签:
1条回答
  • 2021-01-17 19:50

    You are trying to look at Android as a subset of Java which it is not. They are completely separated. Even though Android comes from Java, it as departed from it quite a bit and there is no correlation 'version-wise' anymore between the two.

    What you can look at is the Android documentation. For every instruction/command/method/properties, at the top right you'll find the api level at which you are able to access said property.

    Clicking on the api level will take you to a page which contains a table that translates api level to Android versions.

    The easy way to find out if you are allowed to use a property is using eclipse and doing what you just did : Change the target api level. Then any call to methods or properties that are not available to you will produce fatal errors.

    0 讨论(0)
提交回复
热议问题