Android.net.SntpClient is missing from Android SDK

I am trying to get the time from an internet time server. And I found that android.net.SntpClient is a good solution that I could use.

But my Android SDK (Android API 19) does not contain this class. I downloaded the "Sources for Android SDK" via SDK Manager and the source code contains the SntpClient.java file (source file for android.net.SntpClient class)

Please view the images I have uploaded. (sorry i don't have enough reputation for images right here)

Android SDK: https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/1888504_897281990284152_2310291065247680835_n.jpg?oh=989c5f49848a8914d88Fbb0d4d4

Sources: https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/10659310_897281993617485_1823842706987095742_n.jpg?oh=27ee&6a075967731dc7265352c22002DC

Can anyone tell me why this file is not compiled? If I want to use this class, I have to explain to my boss why the Android SDK doesn't contain it.

Thank you so much

+3


source to share


1 answer


Google decided not to make all public classes available as part of the SDK. Visibility is controlled by the @hide comment tag as described here .



I'm not sure why they chose to hide the SntpClient especially, but as long as you respect the Apache license terms you can copy the source into your application without much change.

+5


source







All Articles