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
This has always been a question that everyone wan...
Today, we will talk about practical techniques fo...
When we mention "design specifications"...
The feedback keywords in Baidu's drop-down me...
After the most recent heavy rainstorm in Beijing,...
Although the Earth is a sphere, its surface is ma...
Using search engines has become a habit, a lifest...
If you are going to change a phone or upgrade you...
Operation promotion plays a very important role i...
This year's 618 is becoming more and more &qu...
About Summer A cool-down device is a must --"...
Tuchong Creative First, let's look at the def...
At present, domestic Internet traffic is becoming...
Some time ago, "AlphaGo" defeated Lee S...