0

My Android app is using install-time Play Asset Delivery to deliver all my game's assets. This asset folder is an arbitrary hierarchy of directories that I need to copy verbatim into my app's file system.

How can I copy this directory structure when AssetManager only provides an InputStream?

I'd like to use something simple like this but it doesn't work.

val assetRoot = assetManager.open("/") val gameDataRoot = FileOuputStream("/gamedata/") assetRoot.copyTo(gameDataRoot) 

Is there some other approach that would work?

1 Answer 1

0

While I didn't find a direct way to do this in the Android SDK, I did find a work-around using the technique outlined in this post. Accessing play asset package directly

You can treat the assets package as a .zip file and decompress your assets directly into your Android file system using Zip4j or other methods.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.