Chapter 6. Graphical User Interface

When Android was being invented, its designers faced many choices whose outcome would determine the success or failure of their project. Once they had rejected all the other smartphone operating systems, both closed and open source, and decided to build their own atop the Linux kernel, they were faced with somewhat of a blank canvas. One important choice was which programming language to use; they wisely chose Java. But once that choice was made, there was the choice of user interface technology to deploy: Java ME, Swing, the Standard Widget Toolkit (SWT), or none of the above.

Java ME is the Java Micro Edition, Sun/Oracle’s official standard API for cell phones and other small devices. Java ME was once a pretty big success story: tens if not hundreds of millions of cell phones have a Java ME runtime inside. Also, all BlackBerry devices made from around 2000 to around 2010, and all BlackBerry smartphone applications for BlackBerry OSes 5, 6 and 7 (but not including BlackBerry OS 10), were based on Java ME. But the Java ME GUI was regarded as too limiting by the Android team, having been designed for the days when cell phones had really tiny screens and limited functionality (it’s noteworthy that BlackBerry came to a similar conclusion, dropping Java ME when it came time to produce BlackBerry 10).

Swing is the Java Standard Edition (desktop Java, Java SE, a.k.a. JDK or JRE) GUI. It is based on Java’s earlier widget toolkit, the Abstract ...

Get Android Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.