Learning the Java Language
Author: Ian Darwin
Android apps are written in the Java(tm) programming language before they are converted into Android's own class file format, DEX. If you don't know how to program in Java you will find it hard to write Android apps.
There are lots of resources available to learn Java. Most of them will teach you what you need, but will also teach some API classes that are not available. Avoid any sections in any book that talk about topics in the left-hand column:
Parts of Java API to Ignore
||Android's GUI, see Introduction: GUI
|application entry point main()
||See Android Lifecycle
||Most of android.* replaces JavaME API
||Designed for server-side use
Here are some books and resources:
- O'Reilly's Java in a Nutshell is a good introduction for programmers, particularly those immigrating from C/C++. This book has grown from an acorn to a coconut in size, to keep up with the growth of Java SE over its lifetime.
- Head First Java provides a great visual-learner-oriented introduction to the language. O'Reilly.
- Java: The Good Parts From the book's web site: "What if you could condense Java down to its very best features and build better applications with that simpler version? In this book, veteran Sun Labs engineer Jim Waldo reveals which parts of Java are most useful, and why those features make Java among the best programming languages available..."
- Java Cookbook (disclosure: I wrote this book) is regarded as a good second book for Java developers. It has entire chapters on Strings, Regular Expressions, Numbers, Dates & Time, Structuring Data, I/O and Directories, Internationalization, Threading and Networking, all of which apply to Android. It has a number of chapters that are specific to Swing and to some EE-based technologies.
What's needed is for somebody to write a book on Android for non-Java Programmers that would include just exactly the right parts of standard Java language and API along with all the Android stuff. Available now in three volumes, ships in its own cool retro wooden case... :-).
This book's editor maintains a list of Java resources online at .
O'Reilly has many of the best Java books around; there's a complete list at .