Closed amsteromer closed 3 years ago
What is the use case here, as compared to the assets/
folder? res/
files give compile time safety by generating ids, but these ids are only available from native code. It is possible to retrieve id by string name, but at that point, why not use assets?
https://developer.android.com/guide/topics/resources/providing-resources.html#OriginalFiles
@alpha0010 I'm having trouble with the time it takes to load sound files in my assets folder (I'm using react-native-sound, and whenever I load the files from my res folder it works much better and faster than loading it from the assets folder)
I would be very happy if you'd help me out
Skimming over react-native-sound
, it looks like they support asset:/example.mp3
to play example.mp3
directly from the assets/
folder. Is that what you are using that is slow?
@alpha0010 Yes, it causes problems playing/stopping the sound. Is there something I can do to help you implement the copyFileRes function?
Live in v1.6.0.
can you please add this feature?
copyFileRes(filename: string, destPath: string): Promise
Copies the file named filename in the Android app's res folder and copies it to the given destPath path. res/drawable is used as the source parent folder for image files, res/raw for everything else.
i really need to use it with scoped storage :)