Increasingly, more and more mobile devices are being sold as sales of laptops and desktop computers have declined. While mobile websites perform reasonably well, native mobile apps still may yield superior user experience. Additionally, with the decline of J2ME, Android has become the preferred way to run Java code on mobile devices. In short, Android development skills are important for any developer to be familiar with because there may be no desktop to run them on someday, and right now a good portion of the users for any product may be mobile users.
Fortunately, Android programming skills are a specialization of Java skills. Hence, a Java developer can transition smoothly to an Android developer. Android apps are written in the same programming language as Java programs, but they run under Android OS and make heavy use of the Android SDK in addition to a standard Java SDK. Another difference is that Java programs can run on many different platforms, but they most likely run on powerful desktops or servers. In contrast, devices that run Android apps have limited computational resources, but a rich set of sensing capabilities. They are also highly mobile and keep a near constant Internet connection. Thus, Android apps are like Java programs, but they take full advantage of the device’s capabilities while running within the constraints of the Android OS.
This chapter reviews major concepts from the Android SDK and shows the code that apps need to accomplish ...