Closed junny-solano closed 4 years ago
This is my little solution, I don't know if it is the most efficient and best solution but it worked, I hope it helps.
**Note: I use retrolambda.
private static List
);
}
private void initNtpServer() {
Observable
.just(getNtpServers())
.concatMap((Function<List
private Single<Boolean> initTrueTime(String ntpServer){
return TrueTimeRx
.build()
.withConnectionTimeout(30000)
.withRetryCount(5)
.withSharedPreferencesCache(this)
.withLoggingEnabled(true)
.initializeRx(ntpServer)
.ignoreElement()
.toSingleDefault(true)
.onErrorReturnItem(false);
}
Hi, is it possible to use a list of NTP servers? I try this, but not work.
private void initRxTrueTime() {
Return this Exception:
something went wrong when trying to initializeRx TrueTimejava.net.UnknownHostException: Unable to resolve host "time.google.com, 0.us.pool.ntp.org": No address associated with hostname