Skip to content

Instantly share code, notes, and snippets.

View rocka's full-sized avatar

rocka

View GitHub Profile
@rocka
rocka / gist:847df66cca3481c4072d6c65011801d6
Last active March 11, 2021 15:13 — forked from tylerchesley/gist:6198074
Function to recursively copy files from an Android asset directory
private fun copyFileOrDir(path: String) {
val assetManager = this.assets
try {
val assets = assetManager.list(path)
if (assets!!.isEmpty()) {
copyFile(path)
} else {
val dir = File("${applicationInfo.dataDir}/${path}")
if (!dir.exists()) dir.mkdir()
for (i in assets.indices) {