Android tutorial - analog clock | Digital Clock - android app development - android studio - android development tutorial
Learn andriod - andriod tutorial - Analog clock - andriod examples - andriod programs
- The android.widget.AnalogClock and android.widget.DigitalClock classes provides the functionality to display analog and digital clocks.
- Android analog and digital clocks are used to show time in android application.
- Android AnalogClock is the subclass of View class.
- Android DigitalClock is the subclass of TextView class. Since Android API level 17, it is deprecated. You are recommended to use TextClock Instead.
- In android, you need to drag analog and digital clocks from the pallet to display analog and digital clocks. It represents the timing of the current device.
- Analog clocks usually indicate time using angles.
- Digital clocks display a numeric representation of time.
- Two numeric display formats are commonly used on digital clocks:
- 24-hour notation and
- 12-hour notation.
- Most digital clocks use electronic mechanisms and LCD, LED, or VFD displays.
- For convenience, distance, telephony or blindness, auditory clocks present the time as sounds.
1. AnalogClock and DigitalClock
- Open “res/layout/main.xml” file,
- add AnalogClock and DigitalClock in XML.
- File : res/layout/main.xml
2. Code
- File : MyAndroidAppActivity.java
3. Demo - android emulator - android tutorial
- Run the application
- This is how AnalogClock and DigitalClock look like