1

I have some media file in my asset folder. I want to get all media files names and files count from my asset folder.

TheMohanAhuja
  • 1,855
  • 2
  • 19
  • 30
SourabhTech
  • 1,357
  • 12
  • 17

1 Answers1

9

A little googling might have helped you!

try this:

AssetManager assetManager = getAssets();
String[] files = assetManager.list("your_folder_name_inside_assets");            
List<String> it = new LinkedList<String>(Arrays.asList(files));
TheMohanAhuja
  • 1,855
  • 2
  • 19
  • 30
  • There is a way to get the folder names that are in the assets folder? – JCarlosR Feb 07 '17 at 22:00
  • 1
    Using an empty string it is possible to get the name of the folders in "assets" (but take a care; because it adds 3 additional folders: images, sounds and webkit). – JCarlosR Feb 07 '17 at 22:18