Friday, 18 February 2022

Accessing assets stored in AAR from application

I have a library project which includes some TFLite models. I want to be able to distribute the library and include the models in the AAR's assets folder. I've put everything in the assets folder and when inspecting the resulting AAR, I see that the models exists.

My question is, how can I access these models? either from the library itself (preferably) or from the application that uses it?

If I look try and access the assets the normal way for an application

AssetManager am = context.getAssets();
am.list(assetFolder)

I get an empty list.

I saw many posts about including assets in an android AAR library but none that referred to how to actually use these assets, so am I missing something very basic here?



from Accessing assets stored in AAR from application

No comments:

Post a Comment