简体   繁体   中英

How much of the Java 6 API is implemented by Android?

I want to port an small open source AES encryption class to Android, and it would cut my work down a lot if the API of Android is as close as possible to the Java 6 API.

How much is implemented (or referenceable), as I have tried searching about this on google, and i have not yet come up with anything useful?

您是否在http://developer.android.com/reference/上查看了Java库参考?

IMHO In general Java 6 works. The compiler does the work for you.

Re self implementing encryption: Please try using Bouncy Castle . In general, self implementation of any known crypto algorithm isn't a good idea.

The compile progress of android project is like that, first compile the source code with java compiler(mainly on SE 5.0 API ) into java byte code as .class file, and such class files will be compiled continuously by dalvik VM into dalvik byte code .dex file. When the app runs, it is in fact .dex running on dalvik vm.

In general you shouldn't have a lot of problem as long as you're not using any graphics or sound-related libraries. Android does not support swing or awt.

Also, this isn't an android limitation, but you'll probably going to be having a lot of trouble with floats, since the platforms that android usually runs on (ARM) do not have a Floating point unit, so you might need to take that into consideration

The new language-side features of Java 6 (such as @Override annotation for interfaces) will generally work; Dalvik VM compiler is compatible with Java 6 *.class files.
On the other hand, the new API features of JDK6, such as String.isEmpty(), java.util.Arrays.copyOf, etc, are either missing or need newer API levels. (API 9 or later in these examples)
If your application targets old Android devices (API 8 or lower), you can only use Java 5 functions.

At a minimum some of the new functions in java.utils.Arrays are missing.

http://code.google.com/p/android/issues/detail?id=10054

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM