package data.displayasset;

import java.io.File;
import java.io.IOException;
import android.os.Bundle;
import android.app.Activity;
import android.content.res.AssetManager;
import android.util.Log;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
	  super.onCreate(savedInstanceState);
	  setContentView(R.layout.activity_main);
	  final AssetManager mgr = getAssets();    
	  displayFiles(mgr, "");
	}

	void displayFiles (AssetManager mgr, String path) {
	  try {
            String list[] = mgr.list(path);
            if (list != null)
              for (int i=0; i<list.length; ++i)
              {                 
                 if ( path.length() >  0 ) {
               	   Log.v("Assests:", path + "/" + list[i]);
                   displayFiles(mgr, path  + "/" + list[i] );
                  }else{
                   Log.v("Assests:", path  + list[i]);
                   displayFiles(mgr, path  + list[i] );
                 }
              }
            else
              Log.v("List:", "empty!");
          } catch (IOException e) {
             Log.v("List error:", "can't list" + path);
          }
       }
}
