Loading...

Get Current Time in Android Programmatically

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

Tutorial 8011712404333245659
Home item