How to load textures from a local folder on Android
My app needs to load images from a local Android folder. I realize that different phones have different directory paths, so a plug-in or workaround might be necessary. For now, I'm just trying to make it work on my own (a Galaxy model..) and load from Downloads, for example.
The app currently uses
//To Load All From Resources
imageSet = Resources.LoadAll<Texture2D>("Image Set");
print("Loaded Textures Folder");
imageSet is an array of Textures. A folder named 'Image Set' exists in the Resources folder in Assets.
This has likely been asked and answered a lot, but I couldn't seem to find a good explicit answer or make things work, using methods discussed here: https://forum.unity.com/threads/using-files-in-android-folders.347800/
It seems that using WWW is now considered obsolete(?)
What is a good way to switch this to load from a specific folder path on Android?
Thank you!
Answer by xxmariofer · May 21, 2019 at 08:09 AM
i always use this pluginwhen i want to retrieve images/videos from gallerys LINK. if you want to retrieve something from inisde your assets folder just use the WWW class (www is obsolet because unitywebrequest is basically the same but faster, but you can still use www if you find it "easier") the www class is really easy to use, just need to pass the path in the constructor, and wait to download (maybe using a corroutine) you can try using the persistentdatapath for saving your project files
Excellent, Thank you! Looks like a winner. Free price and open licensing doesn't hurt either
Your answer
Follow this Question
Related Questions
Unity 5 poor game startup load times on mobile/tablet 0 Answers
Get access to the folder with the file on Android 1 Answer
Android path problems 0 Answers
unity remote 5 connects but dont change anything when patch 0 Answers
Android app dosen't load scenes from obb on install, until device restart 0 Answers