fetching random photos from gallery?

Dave O

Well-Known Member
Licensed User
Longtime User
My game needs to get random photos from the phone's gallery.

There are a bunch of posts about opening the gallery, but I'd like to be able to fetch pictures without opening it. Didn't see anything covering that.

Two ways come to mind (he said naively):
- Use some kind of gallery API to fetch a list of photos, pick a random one, then display it.
- Find out where the photos are stored in the filesystem, and use the File methods to get the list, pick, and display.

Any help much appreciated!
 

Dave O

Well-Known Member
Licensed User
Longtime User
Problem solved - I used the MediaBrowser library by @Informatix. It has a GetMediaImageList method that retrieves all images from the device's mediastore into a map.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…