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
[[152942]] Could it be the boss? Behind every suc...
One of the happiest things in summer Just lying o...
Produced by: Science Popularization China Author:...
In the past 2018, " short video marketing &q...
Xiaomi has been controversial since its birth, bu...
Red snow crab legs as long as your arm are the cr...
Several oil crises have made Japan a powerful cou...
Have you been eyeing a new camera, game console o...
On April 2, Jay Chou posted on Instagram that his...
Today we will talk about why some people are more...
You trust a multinational company and have been u...
On the morning of November 22, after several days...
Skin care products have become a necessity in our...
According to statistics and analysis by the China...
When looking in the mirror Everyone's face sh...