Maybe more precisely, if you regard the API in question as copyrightable, Oracle has clearly licensed it under GPLv2 plus the Classpath Exception.
Also, the issue of copyrightability of the Java SE API has already been definitively decided in this case, in Oracle's favor.
Code for Android Apps contain unrelated public APIs so cannot run on Oracle Java.