Create a Composite Control

A composite widget is an atomic and reusable widget that contains multiple child controls and is associated in a certain layout.   When creating a composite control, you need to define the layout, appearance, and the interaction between the views it

Custom to-do list

In Chapter 2nd, the to-do list example uses textview (in listview) to display each item. You can create a new textview extension and override the ondraw method to customize the appearance of a list.   In this example, you will create a new

Use manifest Editor

The ADT plug-in contains a visual manifest Editor tool to manage manifest files, rather than directly operating XML. Use the manifest editor in eclipse, right-click the androidmanifest. xml file in the project folder, and select open with your

Use views to create the UI of an activity

A new activity starts with an empty screen, on which you can place your own UI. To set the UI, call the setcontentview method and pass the view instance (usually a layout) for display. Since empty screens are not very encouraging, most of you will

Chapter 2 Summary

  Service is one of the most striking reasons for developing applications on the Android platform. In this chapter, you learned how to use these invisible program components to perform operations when the application is hidden in the

Contains static file resources

If your application requires external file resources, you can include them in your distribution package and place them in the/RES/raw folder of the project structure.   To access these read-only file resources, call the openrawresource method of the

Activity of the dialog topic

The dialog box provides a simple and lightweight screen display technique, but sometimes you need to have more control over the content in the dialog box and control its lifecycle.   The solution is to implement it like a complete activity. By

Current comprehensive earthquake sample code

* Http://files.cnblogs.com/xirihanlin/DL090909@cc-Earthquake.zip Except for the Google map section in Chapter 1. Knowledge points used: * Preference data sharing * Service creation and startup * Create and use contentprovider * Internet

Save and load files

It is a good habit to use shared preference and database to store application data. However, sometimes you need to store files directly instead of relying on the android hosting mechanism.   Like standard Java I/O classes and methods, Android

Define menus in XML

Like Android UI layout, you can also define the application menu in XML. Expand the menu layout in the oncreateoptionsmenu method of the menu. This will make our program code much simpler, and put as much interface design part as possible into XML

Use intent filter to implement plug-ins and extensions

So far, you have learned how to explicitly create an implicit intent, but this is only half of the story. Android allows later packages to provide new functions for existing applications. When running, use intent filter to dynamically enter the menu.

Sub-menu and context menu

The context menu is displayed, which is the same as the sub menu displayed in Figure 4-5. A floating window is used. Although they have the same appearance, the two menu types are different. Create Sub-menu The sub-menu is displayed as the

You do not need sqliteopenhelper to open and create databases.

You can use the openorcreatedatabase method in the program context to create and open a database without the help of the sqliteopenhelper class.   Creating a database involves two steps. First, call openorcreatedatabase to create a new database.

Query a database

All database queries return a result set cursor. This method enables android to more effectively manage resources by retrieving and releasing the values of rows and columns as needed.   Execute a database query and use the query method to pass in

Create and trigger notification

Create notification   Three steps are required to create and configure a new notification.   First, you need to create a new notification object and pass in the icon, text, and current time of notification to be displayed on the status bar, as shown

Ongoing and continuous notifications

  You can set flag_insistent and flag_ongoing_event flag to make notification continuous or ongoing.   The notification is marked as ongoing. As shown in the following code, it can be used to indicate the currently ongoing events (such as laidian ).

Add, update, and delete rows

The sqlitedatabase class exposes specific methods, such as insert, delete, and update. These methods encapsulate the SQL statements required to execute these actions. Even so, the execsql method allows you to execute any valid SQL statements on the

Embedded the WPF control in the winform Application

We know that the windowsformhost class is required to add winform controls on the WPF interface. How can I add a WPF control on the winform interface? Are there any similar classes? Obviously, elementhost is defined to embed the WPF element in the

Mobile phone shake

  You can use the mobile phone's vibration function to send a specific style of vibration to the mobile phone for notification. Android allows you to control the vibration style. You can use the vibration to convey information to get users'

Mobile phone flash

  Notification also includes attributes to set the color and blinking frequency of the mobile phone LEDs.   The ledargb attribute is used to set the color of the LED, while the ledoffms and ledonms attributes are used to set the frequency and style

Total Pages: 64722 1 .... 54322 54323 54324 54325 54326 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.