--ADVERTISEMENT--

In this example, I will show how to get (display) current time in android application programmatically. To get current time in android application, we use Calendar class Calendar calendar = Calendar.getInstance();.

Related:
Get Current Date in Android Programmatically
Android Material Design with Design Support Library
Check Internet Connection in Android

Android Example: How to Get (Display) Current Time in Android Programmatically


XML Layout File
res/layout/activity_main.xml

Java Activity File
src/MainActivity.java

Now, run your application and click the Get Current Time button.

Output:

Get Current Time in Android Programmatically
Get Current Time in Android

Post a Comment

Powered by Blogger.