Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section B.2. Alternative programming languages

B.2. Alternative programming languages

When Android was first announced, its use of the Java programming language brought with it some mixed reviews. The main alternative in embedded systems is native code—something that can be compiled to machine directly, such as C, C++, or Objective-C. Compared to those languages, Java is advanced. For example, it’s the only one that has garbage collection. (Objective-C 2.0 has a flavor of garbage collection, but it hasn’t yet found its way into the mobile space.) Many developers consider Java to be overly verbose and restrictive, and in general “long in the tooth.” There are many newer programming languages with more flexible and expressive syntax. Fortunately for aficionados of such languages, Android doesn’t require Java. It requires Java bytecode. Any language that can compile to Java bytecode can then be dexed to Dalvik bytecode that can then run on an Android device. Let’s look at figure B.2 to see how this works.

Figure B.2. Compilation and packaging on Android



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial