jQuery in Action, 2nd edition*
The moose likes Android and the fly likes Java SE and Android Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Java SE and Android" Watch "Java SE and Android" New topic
Author

Java SE and Android

Peter Sorotokin
Ranch Hand

Joined: Jun 25, 2013
Posts: 36
    
    1

In a book about Android is said :
From the mobile application developer’s perspective, Android is a Java environment, but the runtime isn’t strictly a Java VM. This accounts for the incompatibilities between Android and proper Java environments and libraries . If you have a code library that you want to reuse, your best bet is to assume that your code is nearly source compatible, attemp to compile it into an Android project , and then determine how close you are to having usable code.

I heard some packages like Swing and AWT does not work with Android . But in this book is said that every Java SE source code could be compiled under Android and that will work . What is the true thing about relation between Java SE and Android ? Are Swing and AWT source codes compiled and run under Android ?
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41877
    
  63
Swing and AWT do not exist in Android, so while you can compile an Android app that uses them (because you're using a regular JDK for that), any attempt to run that code will end in tears

The Android libraries are most of Java 5 (except parts such as AWT and Swing and ImageIO), plus some extra stuff from Java 6, plus Apache Commons HttpClient and JSON.org, plus the android.* packages.

http://developer.android.com/reference/packages.html has all the available packages.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java SE and Android