Datasheet

15
Chapter 1: Developing Spectacular Android Applications
Figure 1-1:
A chooser.
If the Android system cannot find a match for the intent that was sent, and a
chooser was not created manually, the application will crash due to a run-time
exception: an unhandled error in the application. Android expects developers
to know what they’re doing. If you send an intent that a user’s Android device
doesn’t know how to handle, the device crashes. It’s best practice to create
choosers for intents that don’t target other activities within your application.
Cursorless controls
Unlike PCs, which let you use a mouse to move the cursor across the screen,
Android devices let you use your fingers to do just about anything a mouse
can do. But how do you right-click? Instead of supporting right-clicking,
Android has implemented the long press. Press and hold a button, icon, or
screen for an extended period of time, and a context menu appears. As a
developer, you can create and manipulate context menus. You can allow
users to use two fingers on an Android device instead of just one mouse
cursor, for example. Keep in mind that fingers come in all sizes, however, and
design your user interface accordingly. Make the buttons large enough, with
enough spacing, so that even users with large fingers can interact with your
apps easily.
05_9780470770184-ch01.indd 1505_9780470770184-ch01.indd 15 11/2/10 8:51 AM11/2/10 8:51 AM