Status Update
Comments
ed...@gmail.com <ed...@gmail.com> #2
Nevermind, I see from other posts here that it's currently not possible to use the DataStore API from Java but that Java wrappers might be coming sometime in the future.
Feel free to close this issue.
Description
DataStore Component used: androidx:datastore:datastore DataStore Version used: 1.0.0-alpha04
I'm trying to implement the new typed DataStore API in Java and I'm having some issues. All the documentation seems to be in Kotlin only and trying to create a new data store is not as straight forward from the Java side it seems.
Calling DataStoreFactoryKt.createDataStore() from Java requires me to provide all the arguments including the ones with default values in the Kotlin implementation. There doesnt seem to be any @JvmOverloads annotation for that function, resulting in my predicament.
What's the better way around this, if there is any? Or is the Data Store api simple designed to be used with Kotlin only?
I have no idea how I would go about providing a
CoroutineScope
argument from Java.It would be nice if the documentation included Java examples, unless the
DataStore
API is purposely designed to be used with Kotlin only.