If an Intent is a request for an action to be performed on a set of data, how does Android know which application (and component) to use to service the request? Intent Filters are used to register Act.. Read more
Native Android applications also use Intents to launch Activities and sub-Activities.
The following noncomprehensive list shows some of the native actions available as static string con-stants in the.. Read more
At first glance, the subjects of this chapter may appear to have little in common; in practice, they represent the glue that binds applications and their components.
Mobile applications on most platf.. Read more
In the following example, you’ll be adding some simple menu functions to the To-Do List application you started in Chapter 2 and continued to improve previously in this chapter.
You will add the abil.. Read more
Submenus and Context Menus: Context menus are displayed using the same floating window as the submenus shown in Figure 4-5.
While their appearance is the same, the two menu types are populated differ.. Read more
To define a menu for an Activity, override its onCreateOptionsMenu method. This method is triggered the first time an Activity’s menu is displayed.
The onCreateOptionsMenu receives a Menu object as a.. Read more
Menus offer a way to expose application functions without sacrificing valuable screen space. Each Activity can specify its own Activity menu that’s displayed when the device’s menu button is pressed.
.. Read more
Handling User Interaction Events
To make your new widget interactive, it will need to respond to user events like key presses, screen touches, and button clicks. Android exposes several virtual event.. Read more
Creating completely new Views gives you the power to fundamentally shape the way your applica-tions look and feel. By creating your own controls, you can create User Interfaces that are uniquely suite.. Read more
Compound controls are atomic, reusable widgets that contain multiple child controls laid out and wired together.
When you create a compound control, you define the layout, appearance, and interaction.. Read more
The To-Do List example from Chapter 2 uses TextViews (within a List View) to display each item. You can customize the appearance of the list by creating a new extension of the Text View, overriding th.. Read more
**Introducing Layouts**
Layout Managers (more generally, “layouts”) are extensions of the ViewGroup class designed to control the position of child controls on a screen. Layouts can be nested, lettin.. Read more
To create user-interface screens for your applications, you extend the Activity class, using Views to provide user interaction.
Each Activity represents a screen (similar to the concept of a Form in .. Read more
Creating User Interfaces
It’s vital to create compelling and intuitive User Interfaces for your applications. Ensuring that they are as stylish and easy to use as they are functional should be a prim.. Read more
Within an Activity’s full lifetime, between creation and destruction, it will go through one or more iterations of the active and visible lifetimes. Each transition will trigger the method handlers de.. Read more
One of the most powerful reasons to externalize your resources is Android’s dynamic resource selec-tion mechanism.
Using the structure described below, you can create different resource values for sp.. Read more
Themes are an excellent way to ensure consistency for your application’s UI. Rather than fully define each style, Android provides a shortcut to let you use styles from the currently applied theme.
T.. Read more
Using Resources
---------------
As well as the resources you create, Android supplies several system resources that you can use in your applications. The resources can be used directly from your appl.. Read more
Application resources are stored under the res/ folder of your project hierarchy. In this folder, each of the available resource types can have a subfolder containing its resources.
If you start a pr.. Read more
Unlike most traditional environments, Android applications have no control over their own life cycles. Instead, application components must listen for changes in the application state and react accord.. Read more