• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
1

How to include android assets(not res) folder in a native extension?

Explorer ,
Jan 07, 2015 Jan 07, 2015

Copy link to clipboard

Copied

I have not been able to find any documentation on this subject.  I have an ANE that is using a font to display icons in an activity launched through an ANE.  The font(.ttf) is included in the assets(not res) folder in the android native project. How do I package the assets folder correctly in the ANE so that it can be accessed by the activity?

Note: files in the assets folder are not accessed via the R.* mechanism in native android code.

Any input on this would be great!  Thanks!

TOPICS
Development

Views

728

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 06, 2017 Oct 06, 2017

Copy link to clipboard

Copied

Hey, I have the same question. Did you find a solution?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

LATEST

I don't know "the right way" to do it but you can include any file with `-C` option of `adt`. Unfortunately these are no automatically included in APK when you build final project that uses ANE. So you would have to unpack these files from ANE and then again use `-C` to include them when building final APK. But there is a caveat. As resources associated with packages and could be put in separate folders they are somewhat safe from conflicts. But that is not the case with raw assets. So if multiple ANEs will have assets of the same name then you are in trouble.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines