Your experience on this site will be improved by allowing cookies
To display an analog clock, Android provides the android.widget.AnalogClock class and to display a digital clock Android provides the android.widget.DigitalClock class. Any of these clocks can be used to show time in an Android application. The View class in Android has a subclass named Android AnalogClock, while the TextView class has a subclass named Android DigitalClock. It is, however, deprecated, since Android API level 17. After this, the TextClock is recommended to be used. In API level 23, the AnalogClock widget was deprecated and is no longer supported. Thus, now a hard code will be required to use AnalogClock in an application. In API level 27, it is not available to be dragged from the palette. The DatePicker and TimePicker can be used to change the time of the device. To display analog and digital clocks in android, the analog and digital clocks need to be dragged from the pallet.
activity_main.xml:
In the activity_main.xml file, we will drag the analog and digital clocks.
Activity class:(File: MainActivity.java) In the MainActivity.java file, we are not adding any code.
|
0 comments