Add image to phone gallery?

MotoMusher

Active Member
Licensed User
Longtime User
I have a few samsung devices, I am assuming that gallery is a standard android item, not just samsung? I may be wrong here.

Anyway, I wrote a camera for internal use in my app. I need a way for the user to delete the files. I want my images to show in the gallery for a standard feel for the user, instead of writing my own photo album.

How do I get my images to show up there? Even better, how can I get my own section of gallery so the images are all together?

I have no need to open the gallery, it is just a way for the user to manage disk space and/or work with the images offline from the app afterwards.
 
Last edited:

MotoMusher

Active Member
Licensed User
Longtime User
Never mind. Searched for media scanner instead of gallery and found it.

Dim i As Intent
i.Initialize("android.intent.action.MEDIA_SCANNER_SCAN_FILE", _
"file://" & File.Combine(MyFilePath, filename))
Dim p As Phone
p.SendBroadcastIntent(i)
 
Upvote 0

FabioG

Active Member
Licensed User
Longtime User
Never mind. Searched for media scanner instead of gallery and found it.

Dim i As Intent
i.Initialize("android.intent.action.MEDIA_SCANNER_SCAN_FILE", _
"file://" & File.Combine(MyFilePath, filename))
Dim p As Phone
p.SendBroadcastIntent(i)

and to remove a picture from the gallery?

I know that you have to create the file. nomedia in the directory that contains the images
but not enough.
 
Upvote 0

MotoMusher

Active Member
Licensed User
Longtime User
Mine are disappearing automatically from the gallery when the file is deleted.

By the way, for future readers, the gallery just displays your folder name as the album name in gallery, so name your folder appropriately.
 
Upvote 0

FabioG

Active Member
Licensed User
Longtime User
Mine are disappearing automatically from the gallery when the file is deleted.

By the way, for future readers, the gallery just displays your folder name as the album name in gallery, so name your folder appropriately.

OK, but creating a file .nomedia in the folder you want to exclude the gallery should not show more content.

I created a small application that creates the file .nomedia in the folder of your choice.

That folder is not excluded from the gallery even if I start the media scanner, you need to clear the cache of the gallery.

Do you have other solutions?
thanks
 
Upvote 0

FabioG

Active Member
Licensed User
Longtime User
ok Thanks

I am interested in developing an application that creates the file ".nomedia" (which I did) and that makes recharging the files to the gallery.

Someone can help me?

thanks
 
Upvote 0
Top