Step | Description |
---|---|
1 | You will use Android studio IDE to create an Android application and name it as DateViewDemo under a package com.example.dateviewdemo as explained in the Hello World Example chapter. |
2 | Create an XML res/values/attrs.xml file to define new attributes alongwith their data type. |
3 | Create src/DateView.java file and add the code to define your custom component. It will extend TextView and will have additional functionality to show current date. You will provide attributes parsing logic in of the constructors having AttributeSet as a parameter. |
4 | Modify res/layout/activity_main.xml file and add the code to create DateView instance along with few default attributes and new attributes. |
5 | Run the application to launch Android emulator and verify the result of the changes done in the aplication. |
xml
type column is retrieved using the value() method of the xml data type.