val jsonString_ = File("C:/Users/admin/Document/sample.json").readText()
System.out.println(jsonString_)
//or this
val jsonString = applicationContext.assets.open("../res/sample.json")
.bufferedReader()
.use { it.readText() }
System.out.println(jsonString)
I tried both codes but I get "No such file or directory" or "java.io.FileNotFoundException" errors.I tried Intellij, it worked but it doesn't work on android
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:requestLegacyExternalStorage="true"/>
I added them to the manifest file,nothing changed.