How to access files in Assets folder from iOS module in Libgdx?

194 Views Asked by At

I am trying to get image form assets folder to display it in notification form iOS module. But i could get any solution how to access assets folder from iOS module

  • in android its working just by calling getAssets() but there is no similar function for iOS

I have tried to get image file using Libgdx's following method Gdx.files.internal("/internal-assets/chapter/image.png"); but it is throwing NullPointerException each time

resources are defined in robovm.xml

<resources>
    <resource>
      <directory>assets</directory>
    </resource>
    <resource>
      **<directory>./internal-assets</directory>**
      <includes>
        <include>**</include>
      </includes>
      <skipPngCrush>true</skipPngCrush>
    </resource>
    <resource>
      <directory>data</directory>
    </resource>
  </resources>
1

There are 1 best solutions below

0
Hadi Ahmadi On

in robovm.xml change this:

<directory>assets</directory>

to:

<directory>../android/assets</directory>