React native | Android | List all assets

Spread the love

In react native if you want to list all the assets (base directory files and folder), use the following in the onCreate method of

AssetManager assetManager = getApplicationContext().getAssets();
      try {
        String[] filelist = assetManager.list("");
        System.out.println("The list of files.");
        for(String name:filelist){
      } catch (Exception e) {
        System.out.println("IO Excpetion");