Introduction
This blog helps to explain how to develop a DatePicker app in an Android Application, using Android Studio.

Here, you can create your Application name and choose where your project is stored on the location and click Next button.

Now, we can select the version of an Android; it is Target Android Devices.

Here, we can add the activity and click Next button.

Now, we can write the activity name and click Finish button.

Now, open your project and you will go to the activity_main.xml and afterwards, you will build the design. You should choose the toolbox and if you want some options (DatePicker, button), use the drag and drop method.

Now, we can see the Graphical User Interface design.

Here, you need to build on the design and write .XML code.
activity_mai.xml code.
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="xyz.rvconstructions.www.datepickerapp.MainActivity">
- <DatePicker android:id="@+id/firstDatePicker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00554a" android:datePickerMode="spinner" />
- <Button android:id="@+id/submitButton" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_below="@+id/firstDatePicker" android:layout_centerHorizontal="true" android:layout_marginTop="50dp" android:background="#554800" android:text="submit" android:textColor="#fff" android:textSize="20sp" android:textStyle="bold" /> </RelativeLayout>






Ravi RupareliyaPosted Dec 21, 2016, 12:10 AM
Is it possible to hide future date from datepicker?