0

I want to create functionality to upload media files to my server. So i need to create custom Gallery with multiselection. I can achieve this using RecyclerView and data from ContentResolver like this and this. But this way is VERY long! It takes up to 60 seconds to load all media files via ContentProvider. I see some Gallery apps in PlayMarket:

1) Simple Gallery

2) Gallery

And there are a lot of similar apps. All of them load media on fly, without any delay.

Can anybody tell me how can i obtain all local photos and videos URLs? Do i need to go through all files and folders and collect URLs with specific suffixes?

Community
  • 1
  • 1
MatWay
  • 66
  • 9
  • Load small `thumbnails` not media files directly. – Aspicas Mar 01 '17 at 13:09
  • 1
    "So i need to create custom Gallery with multiselection" -- or, use `ACTION_GET_CONTENT` and `ACTION_OPEN_DOCUMENT` with `EXTRA_ALLOW_MULTIPLE`. "It takes up to 60 seconds to load all media files via ContentProvider" -- use method tracing, `Log` statements, or other techniques to determine precisely where you are spending your time. "Can anybody tell me how can i obtain all local photos and videos URLs?" -- querying `MediaStore` works just fine. – CommonsWare Mar 01 '17 at 13:50

0 Answers0