Android depends on Java. With that, you might think learning Android programming would be relatively straightforward for a Java programmer. My experience has been otherwise. I thought I’d list some of the differences that took me most by surprise. Reading a list like this beforehand might help someone new to Android get going a little quicker, or at least, with a bit less disorientation.
(1) Android is a quickly moving target. This has two main implications:
- the IDE (Eclipse or Android Studio) initial configuration documentation may not be entirely up to date, and once installed will require frequent updates, some of them quite bulky. When updating, an existing project may require steps not mentioned in accompanying documentation (if any exists).
** Virtually all books are out of date to some degree, some even by the time they are published, and can contain deprecated or obsolete code. Always check for errata listings!! Likewise, when searching online for help, be sure and pay attention to the dates of the posts and don’t assume they are still 100% valid. StackOverflow is the main resource for help, and often the most current answers are ranked below the leading answers (which have become stale)–so you have to know to look for them.
(2) The basic structure of an Android program is more like a Java Applet than a Java Application. In fact, it is a more elaborate version of the Java Applet, with additional states. In other words, no “public static void main(String args)”.
(3) XML is used for widget layout, Strings, and many other resources.
(4) In order to run and debug the code one has written, one has to either have Android devices for testing or get an emulator working. Emulator configuration can be rather challenging (see 1 above). I’ve managed it on my Linux with AMD cpu (Windows 7 or Linux with Intel is a bit easier to configure, it seems), and at this point running an update, with the accelerator or working, occurs in 15 seconds, which is within tolerable. (I have a budget-level, but new PC.)
Anything to add to the list?
I’m hoping to see a bit more activity in this forum overall, as JGO is a high-quality community. Am happy to share solutions as I come across them, if there are questions or interest.