Geert
11/24/2020, 10:51 AMJoost Klitsie
11/24/2020, 10:55 AMAndré Kindwall
11/24/2020, 10:56 AMstringResource
for strings.xml resources. If you want to get json assets then you can always get context with ContextAmbient.current
Joost Klitsie
11/24/2020, 10:56 AMGeert
11/24/2020, 10:58 AMJoost Klitsie
11/24/2020, 11:03 AMandroidx.compose.ui.res.ImageResource.kt
I think you can copy/paste the code and adjust what you need. It looks like loadResource
might help you outJavier
11/24/2020, 1:06 PMresources
folder is not even an Android thing, you can achieve it with an extension function which only depends on JVM.fun Any.readResource(file: String): String = this::class.java.classLoader.getResource(file)!!.readText()
Geert
11/24/2020, 1:24 PMJavier
11/24/2020, 1:45 PM!!