A (175)

(Tuis.) #1

590 CHAPTER 15: Developing for Android Wearable Devices


Congratulations! You have developed your first smartwatch app for the popular Neptune Pine
smartwatch!


Summary


In this chapter, you learned about Android wearable development. You learned all about different
types of wearables, including True Android devices and Android peripherals, as well as some of the
key issues regarding wearables and how to optimize apps for this new Android platform.


You created your own Android wearables application for the popular Neptune Pine smartwatch, by
using the New Android Application Project series of dialogs. You used the most memory efficient
layout container, the Android FrameLayout class, and the AnalogClock widget to create a custom
smartwatch face for the Neptune Pine using the public domain planet images from the NASA
website, in keeping with the HelloUniverse theme.


You created the basic smartwatch EarthTime face and tested it on the Neptune Pine smartwatch
using the USB cable. You copied the APK file onto the SD card for the Neptune Pine and then ran
the Android application on the Neptune Pine hardware.


You then took the smartwatch application to the next level and added other planets around the
perimeter of the UI design using the ImageView class. You added a cool space background image
and then did some Java coding to declare and instantiate the AnalogClock and ImageView UI
elements. You then added event handling to the ImageView planet icon UI elements that controlled
the background resource of the AnalogClock widget using the .setBackgroundResource( ) method.


Finally, you tested your smartwatch application thoroughly, and made sure that it worked properly.


In Chapter 16, you will learn all about developing for Android 5.0, which is an advanced 64-bit OS
that includes all of the functional areas of Android that we have covered in the book thus far. As I
mentioned, I saved the most complicated chapter for last. You will be developing an application for
the new 64-bit Android 5.0 operating system using the new IntelliJ IDEA, so exciting times lie ahead!
It’s time to time travel into the future, so onwards and upwards to the Future of Android: The 64-bit
Android 5.0 OS!


Figure 15-47. Test each of the planet icon UI elements and make sure that the planetClock object shows a result

Free download pdf