display images and videos in android Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of display images and videos in android without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I was trying to list all the images and videos in a folder but setting it in recyclerview nor gridview gives a good result. it stucks in the scroll. Please suggest a way how to display all the files in a better way.

This is how i fetch files,

listFile = AllUtils.getFiles(fetchPath, mContext);

displaying part in recyclerview

public void onBindViewHolder(@NonNull DetailViewHolder holder, final int position) {
    if (listFile.get(position).toString().contains("mp4")) {
        Bitmap myBitmap = ThumbnailUtils.createVideoThumbnail(listFile.get(position).toString(), MediaStore.Video.Thumbnails.MINI_KIND);


There are various free open-source libraries are available for android on GitHub for working with images and videos.

I think using BitMap for displaying images is not a good idea instead of BitMap you should use Glide library for displaying images and use fenster for videos.

Import Glide in your project

repositories {

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.7.1'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

Display Image like this:


You can also upload image using url


read more about glide and fenster.

We are here to answer your question about display images and videos in android - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji