How to use app-internal files in Android?

Hi everybody, I need help adding files to an app, which the app will then access internally (audio samples, text files, midi files, vector graphics, pictures, etc.) These are all app-specific assets which would be bundled with the app and only need to be accessed by the app itself.

By following the JUCE Demo, I had no big problems with iOS and macOS. In Projucer, I added the path to the folder which contains the files (“Assets”) under “Custom Xcode Resource Folder” (and under “Extra Android Assets” for Android). I am able to access the files with code such as this:


#if JUCE_IOS
    File myFile = 
       File::getSpecialLocation (File::SpecialLocationType::currentApplicationFile) 
       .getChildFile("Assets").getChildFile(fileName);

#elif JUCE_MAC
    File myFile = 
       File::getSpecialLocation (File::SpecialLocationType::currentApplicationFile) 
       .getChildFile("Contents").getChildFile("Resources") 
       .getChildFile("Assets").getChildFile(fileName);
        
#endif

But I’ve had no success with Adroid. All variations I have tried have failed. I’ve searched the forum and examined the tutorials and examples and have not found an obvious way to get this to work. I have, for example, examined the code of the AudioSynthesiserDemo, where there is a method to load a wav file in Android but it involves ZipFile and seems quite obscure and convoluted compared to the way this is done in iOS and macOS. If someone could explain how this is done properly that would be of immense help!

In case this is useful to anybody, the method shown here ended up working for me (modified to copy all files and not just .wav files): https://forum.juce.com/t/how-to-access-extra-android-assets-within-android-app/28837