Brian Koey
Brian Koey

Reputation: 203

Specify path for android assets subfolder

I would like to know how to specify a string path for android assets sub folder. For instance, I have a sub folder within the assets folder,
e.g: Assets > Myname(Sub folder).

How do I retrieve the String path for this sub folder?

The result I want: String path= "Assets/MyName". I know it might use AssetsManager to retrieve it, but I not sure how to do it exactly.

Upvotes: 2

Views: 853

Answers (2)

Bhavin Nattar
Bhavin Nattar

Reputation: 3215

May this help you:

AssetManager aManager = appContext.getAssets();
String[] filelist = aManager.list("MyName");

for(String name:filelist){
     System.out.println(name);    
}

And if you want pass reference of a file then you can use
file:///android_assets/MyName/yourfilename

Upvotes: 3

user3531909
user3531909

Reputation: 109

you can get path for Asset sub folder as below.

file://android_assets/MyName

Upvotes: 0

Related Questions