Created
August 7, 2011 13:21
-
-
Save poutyface/1130365 to your computer and use it in GitHub Desktop.
Android NativeActivity AssetManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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