Preface
Not long ago, I saw the simulated clock implemented by android on the Internet. It was very interesting. Here is the address:
Http://www.eoeandroid.com/forum.php? MoD = viewthread tid = 58324 unfortunately this method does not exist
Stopwatch. I suddenly became interested and wanted to implement the following analog
an example.
Public class Chapter9Tutorial1Extends Activity{......// Step 1: Provide the IDs of the different Dialog s to be displayed to determine which Dialog s to be displayed.Static final int DATE_DIALOG_ID = 0; // Step 2: Call the corresponding Dialog through showDialog (Dialog ID)Protected void someMethod (....){......ShowDialog (DATE_DIALOG_ID );......}// Override the Acitivity method onCreateDialog (int id). This method tells showDialog () which Dialog is to be displayed and the Dial
Recent projects need to use a time selector, the previous use of the Bootstrap-datetimepicker in the selection date is fine, but its time to choose (Time: points) is a bit awkward, and later found that the Android up alarm when the selector is very good, So I decided to develop a similar time selector for the analog clock.
At first I was just going to make a com
Teach you how to make Android Widgets
Recently, we have to make a bar code scanner (barcode scan) widget in the project and put it on the desktop of the mobile phone. I checked some information on the Internet, investigated the information, and shared the methods with you.
First, let's talk about what widgets are. Widgets
Application of small pendant (also known as a small window pendant) in the android1.5 is the first time, later, android3.0 and android3.1 have been greatly developed, they can show some of the application of common information or some relevant information to the desktop, the standard Android mirror image has many of its own Small pendants, such as: Alarm clock, music, etc.
Figure 1. Example app
(
/* Parameter 1: context. In my example, it is called in an internal class. All parameters that need to be specified as this */Chapter9Test1. this,
/* Parameter 2: Set the Set date callback function */dateSet,
/* Parameter 3, 4, 5: Set year, month, and day */calendar. get (Calendar. YEAR), calendar. get (Calendar. MONTH), calendar. get (Calendar. DATE )). show ();
The last show () indicates that the dialog is displayed. The Set callback function is OnDateSetListener (), as follows:
Jav
1. Introduction to favorites on the desktop
The launcher desktop has four elements in the middle, which are the window widgets of a clock. The following lines are respectively a camera, an Amazon bookmarks, and a folder (the folder contains settings and clock ).
In the code, they are all favorites: appwidget, application, shortcut, and folder.2. view the databas
Original: Android 0 basic Introductory Section 59th: AnalogClock, DigitalClock, and Textclock clock componentsIn the previous issue, we studied DatePicker and Timepicker, which could not fully satisfy our processing of time and date in actual development.If you just want to show the time, without user modification, you can use the DigitalClock and AnalogClock clock
AppWidget, such as the clock on the android desktop, appwidgetandroid
I,1. The App widget is a space on the home desktop, such as a clock. You can click the next icon in the player to play the video.
2. AppWidgetProviderInfo object: provides metadata for App widgets, including layout, update frequency, and other data.
Android has its own clock UI component, AnalogClock and DigitalClock, respectively, for analog and digital clocks. 1.AnalogClock You can customize the dial, hour and minute hand. As follows, just set it in the XML file. - analogclock android:layout_width = "Wrap_content" android:layout_height= "Wrap_content" android:dial=
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.