GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - code4rox/MediaLoaderX

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
medialoaderxlib
medialoaderxlib
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MediaLoaderX

In this library you can get fast

  • Images
  • Audios
  • Videos
  • Files

using Media Store API

Dependency

repositories {

        maven { url 'https://www.jitpack.io' } 
        
}
dependencies {

        implementation 'com.github.code4rox:MediaLoaderX:1.0.0'
        
}

add permission and allow runtime

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

USE

  • Load all Images and Images Folders

  ImageLoaderX(context).getAllImages({ images ->
  
            //  all images list 
            
        }, { imageFolders ->
        
            // all images folder list
            
        })

  • Load all Audios and Audios Folders

      AudioLoaderX(context).getAllAudios({ audios ->

            //  all audios list

        }, { audioFolders ->

            // all audios folder list

        } , { artists ->
           
            // all artist with songs
            
        } , { albums ->
        
           // all albums with songs
        
        })

  • Load all Videos and Videos Folders

   VideoLoaderX(context).getAllVideos ({ videos ->

            //  all videos list 

        }, { videosFolders ->

            // all videos folder list

        })

  • Load all Files and Files Folders

In android 11 and above you need to give MANAGE_EXTERNAL_STORAGE permission to get all files othervoise this give only media files. and don't forget add permission in menifest <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

NOTE: MANAGE_EXTERNAL_STORAGE permission is only granted to specific app types, such as file managers or antivirus apps, and you'll need to justify its use when publishing on the Google Play Store.

   FileLoaderX(context).getAllFiles  ({ files ->

            //  all files list

        }, { fileFolders ->

            // all files folder list

        })

Advance Use

if you want get all images or all folders only use like this

  ImageLoaderX(context).getAllImages({ images ->
            //  all images list  
       )
  ImageLoaderX(context).getAllImages({ imageFolders ->
            // all images folder list
        })
  • Selection , Sorting and Filter
  VideoLoaderX(this).apply {

            // Show only videos that are at least 5 minutes in duration.
            mSelection = "${MediaStore.Video.Media.DURATION} >= ?"
            mSelectionArgs = arrayOf(TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES).toString())

            // if you want sort
            mSortOrder = MediaStore.Video.Media.DATE_ADDED + " DESC"

            // if you want filter
            mFilterVideoExt = arrayOf("mp4", "mkv")

        }.getAllVideos({
            // all videos list
        }, {
            // all videos folder list
        })

Exception handling

and if you have any kind of exception you can deduct like this

  ImageLoaderX(context).getAllImages({ images ->
  
            //  all images list 
            
        }, { imageFolders ->
        
            // all images folder list
            
        },{ error ->
        
           // error message show here
        
        })

About

No description or website provided.

Topics

androidandroid-galleryandroid-libraryimageskotlinkotlin-androidmediamedia-store-apimediastorevideos

Resources

Readme
Activity

Stars

6 stars

Watchers

2 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.