The Android SDK provides a couple controls for getting date and time input from the user.The first is the DatePicker control. It can be used to get a month, day, and year from the user.
Date and time controls.
The basic XML layout resource definition for a DatePicker follows:
As you can see from this example, there aren’t any attributes specific to the DatePicker control.As with many of the other controls, your code can register to receive a method call when the date changes.You do this by implementing the onDateChanged() method. However, this isn’t done the usual way.
The preceding code sets the DatePicker.OnDateChangedListener by a call to the DatePicker.init() method.A DatePicker control is initialized with the current date.A Text View is set with the date value that the user entered into the DatePicker control. The value of 1900 is subtracted from the year parameter to make it compatible with the java.util.Date class.
A TimePicker control is similar to the DatePicker control. It also doesn’t have any unique attributes. However, to register for a method call when the values change, you call the more traditional method of
As in the previous example, this code also sets a TextView to a string displaying the time value that the user entered. When you use the DatePicker control and the TimePicker control together, the user can set a full date and time.
Setting Up Your Android Development Environment
Writing Your First Android Application
Understanding The Anatomy Of An Android Application
Defining Your Application Using The Android Manifest File
Managing Application Resources
Exploring User Interface Screen Elements
Designing User Interfaces With Layouts
Drawing And Working With Animation
Using Android Data And Storage Apis
Sharing Data Between Applications With Content Providers
Using Android Networking Apis
Using Android Web Apis
Using Location-based Services (lbs) Apis
Using Android Multimedia Apis
Using Android Telephony Apis
Using Android 3d Graphics With Opengl Es
Using The Android Ndk
Using Android’s Optional Hardware Apis
Working With Notifications
Working With Services
Extending Android Application Reach
Managing User Accounts And Synchronizing User Data
Handling Advanced User Input
Targeting Different Device Configurations And Languages
The Mobile Software Development Process
Designing And Developing Bulletproof Android Applications
Testing Android Applications
Selling Your Android Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.