I was just surfing the Internet and was shocked to see a hot topic on Reddit. I thought Android had made big news and instantly thought of a title: Google's Android system is doing something incredible - monitoring the frequency of "Clap for Love". https://www.reddit.com/r/programming/comments/16iy537/android_has_a_separate_class_and_documentation_to/ Taking another look, it turns out that the Android development documentation provides a "SexualActivityRecord" class for recording the frequency of sexual life. https://developer.android.com/reference/androidx/health/connect/client/records/SexualActivityRecord Let's take a look at how Google engineers wrote this class. You can see that this class has a total of 3 constants, representing whether Sex takes protective measures:
The main public methods are getProtectionUsed(), getTime(), and getZoneOffset(). The first two are understandable, which are to get the protection measures and the time when they occurred, but what does the last ZoneOffset mean? Could you please explain it to me? As we all know, Kotlin has long been an officially supported development language for Android, so the code for this class is also written in Kotlin, with less than 100 lines in total: SexualActivityRecord.kt Well, this sharing ends here, and everyone is welcome to express their opinions. If you were responsible for writing this class, how would you implement it? |
<<: Review the feature upgrades and innovations of each generation of iPhone
>>: Five-minute technical talk | A brief analysis of Android 14 updates and upgrades
Recently, Australia announced at a conference tha...
Roboto Roboto has been the default font for Andro...
In 2017, among the global automakers with an annu...
Xiaomi Group (01810.HK)'s road to car manufac...
On June 29, Foreign Ministry Spokesperson Zhao Li...
A good website, in addition to having smooth sent...
Q: Will BT and other P2P download methods reduce t...
Lithium batteries can be said to be a major proje...
[[164493]] Why do people think that Wall-E and Ba...
Introduction to CQRS Architecture You should all ...
Recently, the WeChat official account of the Chin...
Uncle San - 2022 latest full-price account gamepla...
Wang Xiaodong, the founder of Kuaiya, researched ...
Recently, when people consult Zhuge Jun about bus...
gossip Drinking a cup of coffee has become a ritu...