This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Java vs. Android

 
Greenhorn
Posts: 23
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question for Jeff, perhaps you would like to comment on. And it is mainly regarding the book "Learn Java for Android Development".
It has always been my understanding that Google has purposefully avoided associating "Android" and "Java" from the inception of Android to try to avoid the mess that they are going through right now with Oracle (SUN). So, now this book is out and it, clearly, embraces the union between the two names. But, at it's core, Android is not java. It uses language syntax that very closely resembles the Java language but the JVM upon which it runs is, truely, not Java but is an Android VM.
How do you reconcile this?

I don't mean to be confrontational! I just would like to start a discussion about this, mainly, to make sure that everyone is clear about the differences between the two.

Thank you!
 
J Kilgrow
Greenhorn
Posts: 23
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just ran across this article this morning:

http://java.dzone.com/articles/android-101-basics?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobby+%2F+Java+Zone%29

So...ok. Dalvik VM is a JVM "mod". But, still not JavaME.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There isn't much to reconcile. The language syntax is actually identical, and most of the classes that are in Java 5 can also be found in Android. Minus AWT/Swing and some other packages, plus the Android GUI toolkit and some other packages (like Apache HttpClient). So Android is both a subset of Java 5 and a superset of Java 5.

The VM is different - Java class files can not be used directly in Dalvik. Luckily, the Android SDK has a tool that can convert Java class files to Dalvik class files, and that tool works for just about any Java class file. So, with that extra step, Java class files can be used in Dalvik (as long as they don't use other classes that aren't part of the Android class libraries).
 
J Kilgrow
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh! I did not realize that ADK provided a conversion tool for .class files! Nice! That's probably more relevant for support libraries than it is for front-end logic. But, still a useful tool. Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic