所有的文件存在于assets 下面,使用相对路径就能访问到。比如: assets/dir/file ,直接通过dir/file进行访问。 assets下面的文件只读,并且有可能被压缩。
void Resource::list(android_app* pApplication,char* pPath)
{
AAssetDir* assetDir = AAssetManager_openDir(
pApplication->activity->assetManager, pPath);
const char* filename;
while ((filename = AAssetDir_getNextFileName(assetDir)) != NULL){
Log::debug("%s", filename);
}
AAssetDir_close(assetDir);
}
Resource::list(mApplication,"");