Skip to content

Instantly share code, notes, and snippets.

@poutyface
Created August 7, 2011 13:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poutyface/1130365 to your computer and use it in GitHub Desktop.
Save poutyface/1130365 to your computer and use it in GitHub Desktop.
Android NativeActivity AssetManager
void android_main(struct android_app *state)
{
app_dummy();
{
AAsset *asset;
uint8_t buf[1024];
log_info("activity: %p\n", state->activity);
log_info("activity.assetManager %p", state->activity->assetManager);
asset = AAssetManager_open(state->activity->assetManager, "Summer.mp3", AASSET_MODE_UNKNOWN);
if(asset != NULL){
while(AAsset_read(asset, buf, 1024) > 0){
// do someting
}
AAsset_close(asset);
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment