Unit - 3 Getting Dates and Times From Users



Lesson Plan: Unit - 03
Subject: P15A2AAD - Android Application Development
Topic of Study: Getting Dates and Times From Users
Grade/Level: Master of Computer Applications
Objective: To understand Getting Dates and Times From Users and its events
Time Allotment: 55 Minutes


  • Getting Dates and Times from users
    • The Android SDK provides a controls for getting date and time input from the user.
    • It can be used to get a month, day, and year from the user.
    • Using Date Picker
      • 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 TextView 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.
      • Exa. of XML Code
      • Exa. of JAVA Code
    • Using Time Picker
      • A TimePicker control is similar to the DatePicker control. 
      • It also doesn’t have any unique attributes. 
      • Exa. of XML Code
      • Exa. of JAVA Code

Thanks a lot for query or your valuable suggestions related to the topic.

Previous Post Next Post

Contact Form