79080331

Date: 2024-10-12 06:54:09
Score: 0.5
Natty:
Report link

Found a solution, the .so files should be placed in assets folder and copied when the app startup.

fun copyAssetToInternalStorage(context: Context, assetFileName: String,saveName:String): String? {
    val file = File(context.filesDir, saveName)
    try {
        context.assets.open(assetFileName).use { inputStream ->
            FileOutputStream(file).use { outputStream ->
                inputStream.copyTo(outputStream)
            }
        }
    } catch (e: IOException) {
        e.printStackTrace()
        return null
    }
    return file.absolutePath
}

Then the path can be accessed.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: HAL9000COM