Rhisl Use Text View and Image View

Use some of the skills and techniques that you learned in this chapter to create a new Hello World! application. Create an application that uses both the TextView and the ImageView to put an image on the screen with a text caption. This is slightly more difficult than using just one View on an Activity. Play with the Views and see what you can create.

The next chapter takes one more look at Hello World! applications, from the perspective of command-line programming.

Q: Does Android have a label or LabelView like most other APIs?

A: No. All text displays are facilitated through the TextView. You can, as some people have done, create a custom View that functions like a label and name it LabelView, but there is no packaged Android LabelView.

Q: Is there an advantage to using <application>.java rather than main.xml to create Views?

A: While there is no documented speed or processor savings in using one over the other, there is one key advantage: By using main.xml, you have a number of Views predefined for your Activity. Then, in your code, you can jump from View to View as needed without having to manually create them in code.

Using the Command-Line Tools and the Android Emulator ^ .

HIHII

■ 1»

■■ "¡ÜT.Är!

IP^ 0

Companies. Click here for terms of use.

Key Skills & Concepts

• Using the Android SDK command-line tools

• Creating a command environment

• Navigating the Android server with a shell

• Using the Android SDK in Linux

So far this book has covered some very broad subjects to get you up and running on the Android platform. At this point, you should be fairly comfortable using Eclipse to create and run a small Android application. You created a new project, edited the main.xml and <activity>.java files, and recompiled the R.java file. These are the basic skills that you need to create Android applications.

In this chapter, you are going to expand and round out those skills by experimenting with command-line application development. Android development does not have to be limited to the confines of the Eclipse IDE. The Android SDK offers a host of command-line tools that can help you develop full applications without the need of a graphical IDE. You will use these command-line tools to create, compile, and run a Hello World! application, first in Windows and then in Linux.

0 0

Post a comment