Hi all, I am new to programming and Android development and I'm trying to create a photo album app for my family. I've created a raw folder in res to store the photos (it doesn't necessary to be inside the res folder, it can be the assets folder as I cannot tell the difference actually). As there are many photos, I don't want to hardcode the filename one by one. Anyone knows how to get the path of the res/raw or assests/raw folder?
If the folder is stored in the SD card, I know we can do something like this:
In my case, if the files are stored in the res/raw folder, how can I do that?
I also tried the following, but it obviously doesn't work...
Please kindly advise. Many thanks.
P.S. The photos are put inside the apk as I really have no idea where to upload my photos and how to load the photos from the Internet/cloud. If this is easy, I would love to know as well ^_^
If the folder is stored in the SD card, I know we can do something like this:
Code:
File sdCard = Environment.getExternalStorageDirectory();
File directory = new File(sdCard.getAbsolutePath() + "/myfolder");
File[] listFiles = directory.listFiles();
String filePath = listFiles[i].getAbsolutePath();
In my case, if the files are stored in the res/raw folder, how can I do that?
I also tried the following, but it obviously doesn't work...
Code:
File directory = new File("android.resource://com.example.photoalbum/raw/");
Please kindly advise. Many thanks.
P.S. The photos are put inside the apk as I really have no idea where to upload my photos and how to load the photos from the Internet/cloud. If this is easy, I would love to know as well ^_^
