{"id":1179,"date":"2016-03-05T07:04:24","date_gmt":"2016-03-05T07:04:24","guid":{"rendered":"http:\/\/abhiandroid.com\/ui\/?page_id=1179"},"modified":"2019-06-12T06:22:57","modified_gmt":"2019-06-12T06:22:57","slug":"analogclock-digitalclock-textclock","status":"publish","type":"page","link":"https:\/\/abhiandroid.com\/ui\/analogclock-digitalclock-textclock","title":{"rendered":"AnalogClock, DigitalClock And TextClock In Android With Example"},"content":{"rendered":"<p>In Android, AnalogClock is a two handed clock one for hour indicator and the other for minute indicator and DigitalClock &amp; TextClock both looks like your normal digital watch on hand which displays the hours minutes and seconds in digital format.\u00a0 You can simply use these two widgets in your application but these components cannot be used to change the time so for that you may use <a href=\"\/ui\/timepicker\">TimePicker<\/a> component.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1223\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-Digital-Clock-And-Text-Clock-Android.jpg\" alt=\"Analog Clock, Digital Clock And Text Clock Android\" width=\"324\" height=\"146\" srcset=\"https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-Digital-Clock-And-Text-Clock-Android.jpg 324w, https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-Digital-Clock-And-Text-Clock-Android-300x135.jpg 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/center><strong><span style=\"color: #ff0000;\">Important\u00a0Note:<\/span>\u00a0<\/strong>AnalogClock, DigitalClock and TextClock all\u00a0are only used for displaying time and you cannot change the time. So if you need to change the time you can\u00a0use Timepicker.<\/p>\n<hr \/>\n<h4><strong>Types Of Clock in Android<\/strong><\/h4>\n<p><span style=\"color: #008000;\"><strong>Analog Clock:<\/strong><\/span><\/p>\n<p>Analog clock is a widget used to display a two handed clock in which one for hour indicator and other one is for minute indicator.<\/p>\n<p><strong>Analog clock\u00a0code in XML:<\/strong><\/p>\n<pre>&lt;AnalogClock\r\nandroid:id=\"@+id\/simpleAnalogClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\" \/&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1224\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-in-Android.jpg\" alt=\"Analog Clock in Android\" width=\"223\" height=\"187\" \/><\/center><span style=\"color: #008000;\"><strong>Digital Clock:<\/strong><\/span><\/p>\n<p>Digital clock is a widget used to display the hours minutes and seconds in digital format.<\/p>\n<p><strong>Digital clock code in XML:<\/strong><\/p>\n<pre>&lt;DigitalClock\r\n    android:id=\"@+id\/simpleDigitalClock\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\" \/&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>Important\u00a0Note: <\/strong><\/span>Digital clock is deprecated in version \u201c API 17 \u201c . From API level 17 you can use TextClock instead of digital clock. Below is the description\u00a0of Text clock in android.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1225\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/Digital-Clock-in-Android.jpg\" alt=\"Digital Clock in Android\" width=\"262\" height=\"167\" \/><\/center><span style=\"color: #008000;\"><strong>Text Clock:<\/strong><\/span><\/p>\n<p>Text Clock is a widget same as Digital\u00a0Clock\u00a0but\u00a0as in API level 17 digital clock is deprecated so we have to use text clock instead of digital clock. If we use text clock in our app then it require minimum API level 17.<\/p>\n<p><strong>Text clock code in XML:<\/strong><\/p>\n<pre>&lt;TextClock\r\nandroid:id=\"@+id\/simpleTextClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\" \/&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1226\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/TextClock-in-Android.jpg\" alt=\"TextClock in Android\" width=\"270\" height=\"175\" \/><\/center><\/p>\n<hr \/>\n<h4><strong>Attributes of AnalogClock<\/strong><\/h4>\n<p>Now let\u2019s \u00a0we describe some common and important attributes that helps us to configure analog, text or digital clock in xml file (layout).<\/p>\n<p><strong><span style=\"color: #008000;\">1. id:<\/span>\u00a0<\/strong>id is an attribute used to uniquely a analog or digital clock. Below is an example code with explanation included, in which we set the id of a analog clock.<\/p>\n<pre>&lt;AnalogClock\r\nandroid:id=\"@+id\/simpleAnalogClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\" \/&gt; &lt;!--\u00a0 id attribute of a analog clock used to uniquely identify it --&gt;\r\n<\/pre>\n<p><span style=\"color: #008000;\"><strong>2. background: <\/strong><\/span>background attribute is used to set the background of a analog, digital or text clock. You can set a color or a drawable in the background. The background color can also be\u00a0set in java class using setBackgroundColor() method.<\/p>\n<p>In below code we\u00a0use\u00a0background attribute to set the Green color for the background of a analog clock.<\/p>\n<pre>&lt;AnalogClock\r\nandroid:id=\"@+id\/simpleAnalogClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:background=\"#0f0\"\/&gt;\r\n&lt;!-- set green color for the background of analog clock --&gt;<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1182\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/background-in-analogclock-digitalclock-textclock.jpg\" alt=\"background in analogclock digitalclock textclock\" width=\"219\" height=\"238\" \/><\/center><strong>Setting background In Java class:<\/strong><\/p>\n<pre>AnalogClock simpleAnalogClock = (AnalogClock)findViewById(R.id.simpleAnalogClock); \/\/ inititate a analog clock\r\nsimpleAnalogClock.setBackgroundColor(Color.GREEN); \/\/ green color for the background of the analog clock\r\n<\/pre>\n<hr \/>\n<h4><strong>Attributes of DigitalClock Or TextClock<\/strong><\/h4>\n<p>Now let\u2019s we discuss\u00a0some attributes of digital clock or text clock and they are not used for\u00a0analog clock:<\/p>\n<p><span style=\"color: #008000;\"><strong>1. padding:<\/strong><\/span>\u00a0padding is an attribute used to set the padding from left, right, top or bottom side of the digitalclock.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Important Note:<\/strong><\/span> Padding attribute has no effect on analog clock.<\/p>\n<ul>\n<li><strong>paddingRight:<\/strong>\u00a0padding right attribute is used to set the padding from the right side of the digital clock<strong>.<\/strong><\/li>\n<li><strong>paddingLeft:<\/strong> padding left attribute is used to set set the padding from the left side of the digital clock<strong>.<\/strong><\/li>\n<li><strong>paddingTop: <\/strong>padding top attribute is used to set the padding from the top side of the digital clock<strong>.<\/strong><\/li>\n<li><strong>paddingBottom: <\/strong>padding bottom attribute is used to set the padding from the bottom side of the digital clock<strong>.<\/strong><\/li>\n<li><strong>Padding: <\/strong>padding attribute is used to set the padding from the all side\u2019s of the digital clock .<\/li>\n<\/ul>\n<p>Below we set the 30dp padding from all the sides of the digital clock.<\/p>\n<pre>&lt;DigitalClock\r\n    android:id=\"@+id\/simpleDigitalClock\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:layout_centerHorizontal=\"true\"\r\n    android:background=\"#0f0\"\r\n    android:padding=\"30dp\"\/&gt;&lt;!-- set  30dp padding from all the sides of the digital clock --&gt;<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1183\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/padding-in-digitalclock-or-textclock-android.jpg\" alt=\"padding in digitalclock or textclock android\" width=\"221\" height=\"194\" \/><\/center><span style=\"color: #008000;\"><strong>2. gravity:<\/strong><\/span>\u00a0The gravity attribute is an optional attribute which is used to control the alignment of the text like left, right, center, top, bottom, center_vertical, center_horizontal etc.<\/p>\n<p>Below we set the right gravity for text of a digital clock.<\/p>\n<pre>&lt;DigitalClock\r\nandroid:id=\"@+id\/simpleDigitalClock\"\r\nandroid:layout_width=\"fill_parent\"\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:layout_centerHorizontal=\"true\"\r\nandroid:textSize=\"25sp\"\r\nandroid:padding=\"20dp\"\r\nandroid:gravity=\"right\"\/&gt; &lt;!--\u00a0 set right gravity for the text of the digital clock --&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1217\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/gravity-in-DigitalClock-Android.jpg\" alt=\"gravity in DigitalClock Android\" width=\"225\" height=\"209\" \/><\/center><span style=\"color: #008000;\"><strong>3. textColor:<\/strong><\/span> textColor attribute is used to set the color of the text of a digital clock. Color value is in the form of &#8220;#argb&#8221;, &#8220;#rgb&#8221;, &#8220;#rrggbb&#8221;, or &#8220;#aarrggbb&#8221;.<\/p>\n<p>Below we set the red color for the displayed text of a digital clock.<\/p>\n<pre>&lt;DigitalClock\r\nandroid:id=\"@+id\/simpleDigitalClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:layout_centerHorizontal=\"true\"\r\nandroid:textSize=\"25sp\"\r\nandroid:padding=\"20dp\"\r\nandroid:textColor=\"#f00\"\/&gt; &lt;!--\u00a0 red color for the displayed text --&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1218\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/textColor-in-DigitalClock-Android.jpg\" alt=\"textColor in DigitalClock Android\" width=\"217\" height=\"216\" srcset=\"https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/textColor-in-DigitalClock-Android.jpg 217w, https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/textColor-in-DigitalClock-Android-150x150.jpg 150w\" sizes=\"auto, (max-width: 217px) 100vw, 217px\" \/><\/center><strong>Setting textColor of Digital Clock In Java class:<\/strong><\/p>\n<pre>DigitalClock simpleDigitalClock = (DigitalClock)findViewById(R.id.simpleDigitalClock); \/\/ initiate a digital clock\r\nsimpleDigitalClock.setTextColor(Color.RED); \/\/ red text color for displayed text\r\n<\/pre>\n<p><span style=\"color: #008000;\"><strong>4. textSize:<\/strong><\/span> textSize attribute is used to set the size of text of a digital clock. We can set the text size in sp(scale independent pixel) or dp(density pixel).<\/p>\n<p>Below we set the 40sp size for the text of a digital clock.<\/p>\n<pre>&lt;DigitalClock\r\nandroid:id=\"@+id\/simpleDigitalClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:layout_centerHorizontal=\"true\"\r\nandroid:padding=\"20dp\"\r\nandroid:textSize=\"40sp\" \/&gt; &lt;!--\u00a0 set 40sp for the displayed text size --&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1219\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/textSize-in-DigitalClock-Android.jpg\" alt=\"textSize in DigitalClock Android\" width=\"221\" height=\"255\" \/><\/center><strong>Setting textSize of DigitalClock In Java class:<\/strong><\/p>\n<pre>DigitalClock simpleDigitalClock = (DigitalClock)findViewById(R.id.simpleDigitalClock); \/\/ initiate a digital clock\r\nsimpleDigitalClock.setTextSize(25); \/\/ set size for displayed text\r\n<\/pre>\n<p><span style=\"color: #008000;\"><strong>5. textStyle<\/strong><strong>:<\/strong><\/span> textStyle attribute is used to set the text style of a digital clock. You can set\u00a0bold, italic and normal. If we need to use two or more styles for a digital clock then \u201c|\u201d operator is used for that.<\/p>\n<p>Below we set the bold and italic text styles for text of a digital clock.<\/p>\n<pre>&lt;DigitalClock\r\nandroid:id=\"@+id\/simpleDigitalClock\"\r\nandroid:layout_width=\"wrap_content\"\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:layout_centerHorizontal=\"true\"\r\nandroid:padding=\"20dp\"\r\nandroid:textSize=\"25sp\"\r\nandroid:textStyle=\"bold|italic\" \/&gt; &lt;!--\u00a0 set bold and italic text style for the displayed text --&gt;\r\n<\/pre>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1220\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/textStyle-in-DigitalClock-Android.jpg\" alt=\"textStyle in DigitalClock Android\" width=\"219\" height=\"197\" \/><\/center><\/p>\n<hr \/>\n<h4><strong>Example of Analog and Digital Clock:<\/strong><\/h4>\n<p>Below is the example of Analog and Digital\u00a0Clock in Android in which we display\u00a0 a simple analog and digital clock by using their different properties and perform click event on them so whenever a user click on a clock the name of the clock is displayed by using a Toast. Below is the final output, download code and step by step tutorial:<\/p>\n<p style=\"text-align: center;\"><a class=\"download\" href=\"https:\/\/github.com\/abhisheksaini4\/AnalogAndDigitalClock\" target=\"_blank\" rel=\"nofollow\">Download Project Code<\/a><a class=\"help\" title=\"Learn How To Download Code And Import In Android Studio\" href=\"\/androidstudio\/download-code-abhiandroid\" target=\"_blank\" rel=\"nofollow\"> ? <\/a><\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1221\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio.jpg\" alt=\"Analog Clock and Digital Clock Example in Android Studio\" width=\"231\" height=\"364\" srcset=\"https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio.jpg 231w, https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio-190x300.jpg 190w\" sizes=\"auto, (max-width: 231px) 100vw, 231px\" \/><\/center><span style=\"color: #008000;\"><strong>Step 1:<\/strong><\/span> Create a new project and name it <strong>AnalogAndDigitalExample<\/strong><\/p>\n<p><span style=\"color: #008000;\"><strong>Step 2:<\/strong><\/span> Open res -&gt; layout -&gt;\u00a0<strong>activity_main.<\/strong><strong>xml (or) main.xml<\/strong>\u00a0and add following code:<\/p>\n<p>In this step we open an xml file and add the code for displaying two clocks and two text view for displaying name of the clock.<\/p>\n<pre>&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:paddingBottom=\"@dimen\/activity_vertical_margin\"\r\n    android:paddingLeft=\"@dimen\/activity_horizontal_margin\"\r\n    android:paddingRight=\"@dimen\/activity_horizontal_margin\"\r\n    android:paddingTop=\"@dimen\/activity_vertical_margin\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;TextView\r\n        android:id=\"@+id\/textView1\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_centerHorizontal=\"true\"\r\n        android:text=\"@string\/analogClock\"\r\n        android:textSize=\"25sp\"\r\n        android:textStyle=\"bold\" \/&gt;\r\n\r\n    &lt;AnalogClock\r\n        android:id=\"@+id\/simpleAnalogClock\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_centerHorizontal=\"true\"\r\n        android:layout_marginTop=\"50dp\"\r\n        android:background=\"#0f0\"\r\n        android:padding=\"50dp\" \/&gt;\r\n\r\n    &lt;TextView\r\n        android:id=\"@+id\/textView2\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_below=\"@+id\/simpleAnalogClock\"\r\n        android:layout_centerHorizontal=\"true\"\r\n        android:layout_marginTop=\"50dp\"\r\n        android:text=\"@string\/digitalClock\"\r\n        android:textSize=\"25sp\"\r\n        android:textStyle=\"bold\" \/&gt;\r\n\r\n    &lt;DigitalClock\r\n        android:id=\"@+id\/simpleDigitalClock\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_below=\"@+id\/textView2\"\r\n        android:layout_centerHorizontal=\"true\"\r\n        android:layout_marginTop=\"20dp\"\r\n        android:background=\"#0f0\"\r\n        android:padding=\"20dp\"\r\n        android:textColor=\"#fff\"\r\n        android:textSize=\"25sp\"\r\n        android:textStyle=\"bold\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p><span style=\"color: #008000;\"><strong>Step 3:<\/strong><\/span> Open\u00a0 \u00a0src -&gt; package -&gt;\u00a0<strong>MainActivity.<\/strong><strong>java<\/strong><\/p>\n<p>In this step we open\u00a0MainActivity\u00a0where\u00a0we add the code to\u00a0initiate the digital and analog clock and then perform click event on them, so whenever a user click on a clock the name of the clock is displayed by using a Toast.<\/p>\n<pre>package example.abhiandroid.analoganddigitalclock;\r\n\r\nimport android.graphics.Color;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.view.Menu;\r\nimport android.view.MenuItem;\r\nimport android.view.View;\r\nimport android.widget.AnalogClock;\r\nimport android.widget.DigitalClock;\r\nimport android.widget.Toast;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n        \/\/ inititate the digital and analog clock\r\n        DigitalClock simpleDigitalClock = (DigitalClock) findViewById(R.id.simpleDigitalClock);\r\n        AnalogClock simpleAnalogClock = (AnalogClock) findViewById(R.id.simpleAnalogClock);\r\n        \/\/ perform click event on analog clock\r\n        simpleAnalogClock.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                Toast.makeText(MainActivity.this, \"Analog Clock\", Toast.LENGTH_SHORT).show(); \/\/ display a toast for analog clock\r\n            }\r\n        });\r\n        \/\/ perform click event on digital clock\r\n        simpleDigitalClock.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                Toast.makeText(MainActivity.this, \"Digital Clock\", Toast.LENGTH_SHORT).show(); \/\/display a toast for digital clock\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n}<\/pre>\n<p><span style=\"color: #008000;\"><strong>Step 4:<\/strong><\/span> Open res -&gt; values -&gt;\u00a0<strong>strings.<\/strong><strong>xml<\/strong><\/p>\n<p>In this step we open\u00a0string file which is used to store string data of the app.<strong>\u00a0 <\/strong>In this example we store two strings one for analog clock and other for digital clock.<\/p>\n<pre>&lt;resources&gt;\r\n&lt;string name=\"app_name\"&gt;AnalogAndDigitalClock&lt;\/string&gt;\r\n&lt;string name=\"hello_world\"&gt;Hello world!&lt;\/string&gt;\r\n&lt;string name=\"action_settings\"&gt;Settings&lt;\/string&gt;\r\n&lt;string name=\"analogClock\"&gt;Analog Clock&lt;\/string&gt;\r\n&lt;string name=\"digitalClock\" &gt;Digital Clock&lt;\/string&gt;\r\n&lt;\/resources&gt;\r\n<\/pre>\n<p><span style=\"color: #008000;\"><strong>Output:<\/strong><\/span><\/p>\n<p>Now run the App in AVD and you will see time shown in Analog Clock and Digital Clock.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Important Note:<\/strong><\/span> Text Clock example will be\u00a0similar to digital clock. As we already discussed earlier in this article for\u00a0API level 17 or higher you will need to use TextClock instead of DigitalClock in Android.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1221\" src=\"\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio-190x300.jpg\" alt=\"Analog Clock and Digital Clock Output\" width=\"190\" height=\"300\" srcset=\"https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio-190x300.jpg 190w, https:\/\/abhiandroid.com\/ui\/wp-content\/uploads\/2016\/03\/Analog-Clock-and-Digital-Clock-Example-in-Android-Studio.jpg 231w\" sizes=\"auto, (max-width: 190px) 100vw, 190px\" \/><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Android, AnalogClock is a two handed clock one for hour indicator and the other for minute indicator and DigitalClock &amp; TextClock both looks like your normal digital watch on hand which displays the hours minutes and seconds in digital format.\u00a0 You can simply use these two widgets in your application but these components cannot &hellip; <a href=\"https:\/\/abhiandroid.com\/ui\/analogclock-digitalclock-textclock\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">AnalogClock, DigitalClock And TextClock In Android With Example<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"home.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-1179","page","type-page","status-publish","hentry"],"acf":[],"psp_head":"<title>AnalogClock, DigitalClock And TextClock In Android With Example \u2013 Abhi Android<\/title>\r\n<meta name=\"description\" content=\"Learn how Analog Clock, Digital Clock and Text Clock are used in Android to display the time to user with example in Android Studio.\" \/>\r\n<meta name=\"robots\" content=\"index,follow\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/abhiandroid.com\/ui\/analogclock-digitalclock-textclock\" \/>\r\n","_links":{"self":[{"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/pages\/1179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/comments?post=1179"}],"version-history":[{"count":4,"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/pages\/1179\/revisions"}],"predecessor-version":[{"id":2774,"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/pages\/1179\/revisions\/2774"}],"wp:attachment":[{"href":"https:\/\/abhiandroid.com\/ui\/wp-json\/wp\/v2\/media?parent=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}