Comments (11)
How do I register for True time as a new instacart shopper?
from truetime-android.
I came across the same issue, @joknu1 have you found a workaround for this?
My only idea is to clear the cache, but this way I lose the ability to check the time until a new initialization goes through successfully.
from truetime-android.
I came across the same issue, @joknu1 have you found a workaround for this?
My only idea is to clear the cache, but this way I lose the ability to check the time until a new initialization goes through successfully.
No, I didn't. I still use this lib, but since the project I'm working on only cares for drift in the scale of 1 hour, it does not seem critical for our project's purpose. Le t me know if you find any workaround @Colanderr !
from truetime-android.
I have created a kotlin extension as a work around for this issue if anyone is interested
https://gist.github.com/john-stemberger/bab63c3935cdda052d2baf92732a2b85
from truetime-android.
@kaushikgopal Need your help. we are using vanilla version in our app and Re-sync seems impossible if cache option is enabled. Which method should I use to do re-sync in vanilla version?. Because requestTime(ntpHost)
is a package-private in 'TrueTime'.
I am using below solution
class CustomCacheCacheImpl (private val doingResync: Boolean): CacheInterface {
...
...
override fun get(key: String?, defaultValue: Long): Long {
// On Force Sync return 0 so that {isInitialized()} will return false.
if (doingResync && key.equals(CacheInterface.KEY_CACHED_BOOT_TIME)) return 0
return _sharedPreferences.getLong(key, defaultValue)
}
from truetime-android.
如果有人感兴趣的话,我已经创建了一个 kotlin 扩展作为解决此问题的方法
https://gist.github.com/john-stemberger/bab63c3935cdda052d2baf92732a2b85
hello,i want to use you method. However, it can't be allowed to change this code as the library. Could you tell the solition
from truetime-android.
@liu0527aa you can try alpha version of truetime. There you do not need to use requestTime(ntpHost)
. Or else you can use mine approach where you need to use custom implementation of Cache and update key KEY_CACHED_BOOT_TIME
manually.
from truetime-android.
@liu0527aa you can try alpha version of truetime. There you do not need to use
requestTime(ntpHost)
. Or else you can use mine approach where you need to use custom implementation of Cache and update keyKEY_CACHED_BOOT_TIME
manually.
I feel very embarrassed to ask where can i find the alpha version of truetime。。。And how to use the alpha version
from truetime-android.
4.0.0.alpha @liu0527aa
from truetime-android.
4.0.0.alpha@liu0527aa
yes,i find it。however, when i use the library of 4.0.0. I met this mistake,the author didn't push the 4.0.0.alpha to jitpack.io。could u give me some suggestion? thanks!
from truetime-android.
At 3.5 version, I fix this by calling .initializeNtp
instead of .initializeRx
. initializeNtp
is called internally by .initializeRx
if TrueTimeRx
isn't initialized. It helps to not use cached version during clock re-sync.
It looks like this
TrueTimeRx.build()
.initializeNtp(NTP_APPLE)
.subscribeOn(Schedulers.io())
.map { TrueTimeRx.now() }
from truetime-android.
Related Issues (20)
- Why do we need to put TrueTime initialization inside of the class that extends application?
- How can use list of NTP servers? HOT 1
- DiskCacheClient.isTrueTimeCachedFromAPreviousBoot boot time change check flaw HOT 1
- untrusted stratum value for TrueTime: 0 ? HOT 1
- This library is not mantained any longer! HOT 2
- Fatal Exception: io.reactivex.exceptions.UndeliverableException in version 3.4 HOT 7
- The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with [SntpClient.java line 116] HOT 1
- It is possible to get synced clock with difference of 10ms maximum?
- It is possible to get synced clock with difference of 10ms maximum?
- dd
- Vulnerable exported broadcast receiver HOT 1
- Outdated Versions of NTP Leaving Users Vulnerable - NTP v3 HOT 7
- Request: Upgrade truetime to work with Android 12 HOT 8
- RxJava3 support HOT 2
- Error : You need to call init() on TrueTime at least once. HOT 7
- TrueTime init() got crash HOT 1
- Add GPS time provider
- Provide default cache implementation using DataStore
- Hi HOT 1
- Exception thrown on Scheduler.Worker thread. Add `onError` handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truetime-android.