Summary of Important View Groups
These objects all hold child UI elements. Some provide their own form of a visible UI, while others are invisible structures that only manage the layout of their child views. Layout that acts as a view frame to display a single object. A horizontal scrolling display of images, from a bound list. Displays a scrolling grid of m columns and n rows. A layout that organizes its children into a single horizontal or vertical row. It creates a scrollbar if the length of the window exceeds the length of...
Issuing Shell Commands
Adb provides an ash shell that you can use to run a variety of commands on an emulator or device. The command binaries are stored in the file system of the emulator or device, in this location You can use the shell command to issue commands, with or without entering the adb remote shell on the emulator device. To issue a single command without entering a remote shell, use the shell command like this adb -d -e -s lt serialNumber gt shell lt shellCommand gt To drop into a remote shell on a...
For each node dmtracedump shows callname where
lt ref gt -- Call reference number, as used in trace logs lt inc-ms gt -- Inclusive elapsed time milliseconds spent in method, including all child methods lt exc-ms gt -- Exclusive elapsed time milliseconds spent in method, not including any child methods lt numcalls gt -- Number of calls The usage for dmtracedump is The tool then loads trace log data from lt trace-base-name gt .data and lt trace-base-name gt .key. The table below lists the options for dmtracedump. Dump the trace file instead...
Android Emulator
The Android SDK includes a mobile device emulator -- a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device. The Android emulator mimics all of the typical hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control keys, which you can press using your mouse or keyboard to generate events...
Update Your Eclipse ADT Plugin
If you don't use the Eclipse IDE for development, skip to Run Your Applications. A new version of the ADT Plugin, ADT 0.9.3, is available in conjunction with this SDK release. To use the SDK, you must upgrade your ADT Plugin to version 0.9.3. With ADT 0.9.3, you can still compile your existing applications against multiple platform versions, such as Android 1.5, Android 1.1, and so on. However, ADT 0.9.3 is not compatible with previous versions of the SDK and its tools, so make sure that you...
description Mqa
Declares a broadcast receiver a BroadcastReceiver subclass as one of the application's components. Broadcast receivers enable applications to receive intents that are broadcast by the system or by other applications, even when other components of the application are not running. There are two ways to make a broadcast receiver known to the system One is declare it in the manifest file with this element. The other is to create the receiver dynamically in code and register it with the...
Unselected tab icon Light effects and shadows
Unselected tab icons look just like the selected tab icons, but with a fainter inner shadow, and the same front part gradient as the dialog icons. Figure 10. Light, effects, and shadows for unselected tab icons. 1. Front part gradient overlay angle 90 bottom color r 223 g 223 b 223 top color r 249 g 249 b 249 bottom color location 0 top color location 75 2. Inner black 10 opacity angle 90 distance shadow 2px size 2px 3. Inner bevel depth 1 direction down size 0px angle 90 altitude 10 highlight...
Integer Primary Key Autoincrement
The AUTOINCREMENT descriptor is optional. But without it, SQLite increments an ID counter field to the next number above the largest existing number in the column. If you delete the last row, the next row added will have the same ID as the deleted row. AUTOINCREMENT avoids this by having SQLite increment to the next largest value whether deleted or not. Carefully document the data type of each column. Clients need this information to read the data. If you are handling a new data type, you must...
Filling the Layout with Data
Inserting data into the layout is typically done by binding the AdapterView class to an Adapter, which retireves data from an external source perhaps a list that the code supplies or query results from the device's database . The following code sample does the following 1. Creates a Spinner with an existing View and binds it to a new ArrayAdapter that reads an array of colors from the local resources. 2. Creates another Spinner object from a View and binds it to a new SimpleCursorAdapter that...
The component name is set by setComponent setClass or setClassName and read by
A string naming the action to be performed or, in the case of broadcast intents, the action that took place and is being reported. The Intent class defines a number of action constants, including these The URI of the data to be acted on and the MIME type of that data. Different actions are paired with different kinds of data specifications. For example, if the action field is ACTION EDIT, the data field would contain the URI of the document to be displayed for editing. If the action is...
Checkable menu items
Any menu item can be used as an interface for turning options on and off. This can be indicated with a checkbox for stand-alone options, or radio buttons for groups of mutually exlusive options see the screenshot, to the right . Note Menu items in the Icon Menu cannot display a checkbox or radio button. If you choose to make items in the Icon Menu checkable, then you must personally indicate the state by swapping the icon and or text each time the state changes between on and off. To make a...
color value
Value is a color, using web-style syntax, as describe above. Has only one attribute name - The name used in referring to this color. The following code declares two colors, the first fully opaque, and the second translucent. opaque red gt f00 lt color gt translucent red gt 8 0ff0000 lt color gt layout width fill parent layout height wrap content textColor color translucent red
Widget graphics tips and tricks
The Android team has developed a few tricks for aligning widget artwork within standard widget bounding boxes and frames, so the widget aligns visually with other widgets and the other elements of the Home screen, as well as other techniques for creating widgets. Use a screen shot from the Android SDK emulator to align both the shapes and shadows of your widget controls with the Search widget and with other elements on the Home screen. Cut the widget artwork asset based on the full size of a...
putExtras and getExtras methods
Flags of various sorts. Many instruct the Android system how to launch an activity for example, which task the activity should belong to and how to treat it after it's launched for example, whether it belongs in the list of recent activities . All these flags are defined in the Intent class. The Android system and the applications that come with the platform employ Intent objects both to send out system-originated broadcasts and to activate system-defined components. To see how to structure an...



