Ok that's a great start!
I've been experimenting, and when I change my gradle snippet from before to
assets.srcDirs 'some/random/directory/on/my/hd'
then, when I enumerate the root assets directory via
AAssetDir *rootAssets = AAssetManager_openDir(aassman, "");
const char *f = AAssetDir_getNextFileName(rootAssets);
while(f)
{
log(f);
f = AAssetDir_getNextFileName(rootAssets);
}
AAssetDir_close(rootAssets);
I get all of the files that were in that directory, but none of the directories.
This would explain why, when I have my gradle assets.srcDirs set to what it was before ('build/cmake/release/arm64-v8a/resources'), the enumeration prints nothing.
Is it not possible to simply plop my resources directory hierarchy into my apk?
I'm unsure which possibility is occurring:
1. the resources hierarchy is present in the .apk, but "getNextFileName" bypasses directories, and my AAssetManager_open calls to that hierarchy ("resources/images/blah0.png") is inexplicably failing for some other reason
2. the resources hierarchy isn't present, because gradle's assets.srcDirs only copies files and not directories
3. there is some restriction on using gradle, or AAsset, or both which forbids hierarchies altogether?
4. ????
What I want is simply the ability to tell gradle "please put the resources folder and its contents where it is accessible in the .apk". I feel like this is an extremely standard and not-niche request, yet am having a ton of trouble finding any documentation showing just that.
The examples you linked seem to point to a flat resources folder, and then access their content by enumerating the files from that folder (rather than any "hardcoded" relative filepaths).
Another concern of mine is- if I'm pointing to my "resources" folder via gradle, will that copy its contents, but not the folder itself? so if I want the folder itself copied, I should put the resources folder in another folder where it is the sole entry, and instead point to that?
Please excuse my verbosity here- I appreciate your help and want to be clear that what I want is something I would expect should be quite simple!