Programming Android

NDK AAsset_read

steloflute 2012. 7. 21. 00:39
http://ian-ni-lewis.blogspot.kr/2011/01/in-which-i-access-file.html

 

  AAsset* pAsset = AAssetManager_open(ctx->app->activity->assetManager, "readme.txt", AASSET_MODE_UNKNOWN);
  
  const int count = 80;
  char buf[count + 1] = {0};

  while (AAsset_read(pAsset, buf, count) > 0) {
    LOGI(buf);
  }
  AAsset_close(pAsset);