Search code examples
androidkotlinandroid-jetpack-composeandroid-widgetglance

Android App Widgets on Android 12 and higher update interval


I have noticed some strange thing on all app analog clock widgets including Samsung analog clock widget. they are all displaying second hand on devices running android 12 and higher and hide it on devices running android 11 or lower. I have search and read all documentation about Glance Api and everything related to widgets in android 12 but I found nothing that related to update widget every second except for Alarm Manager which can be used prior to android 12 also

Any ideas how to implement analog clock with second hand in a battery efficient way? and is there anything in android 12 related to updating the widget every second?


Solution

  • I find out what is the proplem in case someone is having the same issue Analog Clock widgets uses the AnalogClock class which handle the updates of moving clock hands after searching on the android attrs I found out that android:hand_second was not added till android 12