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
Content at a glance: Extreme weather such as thun...
Your browser does not support the video tag Calab...
Alzheimer's disease may seem far away, but it...
After reading this article, you will get the foll...
Due to the global supply crisis of semiconductors...
Build your own site group from scratch: you only ...
recent Including Beijing Started in multiple plac...
May is almost halfway through, and brands are sti...
This article takes the Moment APP as an example. ...
It is estimated that digital media advertising sp...
2021 is worth looking forward to for everyone. We...
It's not even the beginning of the dog days y...
Compared to eating out, do you think cooking at h...
The incidence of Parkinson's disease increase...