[Feature request] Create Album in Android gallery
Platforms
Android
Description
Creating album works in ios. As far as I made my research I could not find any legit way to create custom album in android gallery. Other apps like instagram or whatsapp does it, they have their albums named after them. I can create album by using paths such as '/storage/self/primary/Pictures/MyAppAlbumName' or '/storage/emulated/0/Pictures/MyAppAlbumName' but I am not sure if it will work on majority of devices. Anyway is there a way to do it with this plugin, can it be done? It would be cool since I use this plugin for many other functionality as well.
Why
I will utilize it so that when user saves image from app to gallery, those images will be under a folder to be found easily later. It will be more organized as well.
any update?
Saving assets to an album can be implemented, but creating an album only means creating a folder that contains zero assets, which the library can only obtain until it has assets stored in it.
Hello,
Try this, it worked for me; I created a folder named "testphotofolder"
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DISPLAY_NAME, folderName.toString());
values.put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg");
values.put(MediaStore.MediaColumns.RELATIVE_PATH,"Pictures/testphotofolder");
if (getActivity().getContentResolver().insert(MediaStore.Images.Media.getContentUri("external"), values) != null) {
Toast.makeText(getActivity(), "Folder created: ", Toast.LENGTH_SHORT).show();
}
I also added the necessary permissions to access the media storage, but this depends on your target version.