How does Android's Java version relate to a Java SE version?

jfritz42 picture jfritz42 · Sep 24, 2011 · Viewed 29.5k times · Source

I am constantly wondering how the Java version used for Android development relates to a Java SE version. For example, I was reading today about "Type Inference and Generic Methods" which is a feature added in Java SE 7. I wonder to myself, "Can I use this in Android code?"

Of course I could type the code into an Android project and see if it compiles, but I'd be happier to have some kind of mapping in my head.

I've tried Googling for this info, checking the Android docs, etc, but can't find an answer.

Edit: I'm more interested in language features, e.g. how does the Android Java syntax version relate to Java SE syntax.

Answer

pents90 picture pents90 · Sep 24, 2011

Android's version doesn't directly relate to Java SE, although it uses a subset of Apache Harmony's SE 6 libraries and tools. It will be up to the Android team to decide if & when to support/require the SE 7 version of Harmony.

Edit It looks like as of KitKat Android supports Java SE 7 language features. See the comments below.