0

I need to pass a third party library the path of an image that is stored in my assets folder

I have read a few answers but none helped. I have tried file:///android_asset/uk.jpg and it doesn't work

1 Answer 1

1

I need to pass a third party library the path of an image that is stored in my assets folder

There is no path. Your asset is not a file. It is an entry in a ZIP archive, nothing more.

Your options are:

  1. Open an InputStream on the asset using open() from AssetManager, and pass that InputStream to the library

  2. Open an InputStream on the asset using open() from AssetManager, use that to copy the asset to some location (e.g., internal storage), then pass the path to the file that you just created

  3. Switch to a library that allows you to supply an InputStream or is Android-aware and supports assets directly

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.