B4A Library FilePicker Library for Android Wrapper -InlineJAVA

A FilePicker library for Android for selecting multiple types of files and also to capture Images and Videos.
This wrapper of : https://github.com/jaiselrahman/FilePicker

Configuration:

MethodsDefault valueUses
setShowImages(boolean)trueWhether to load Images files
setShowVideos(boolean)trueWhether to load Videos files
setShowAudios(boolean)falseWhether to load Audio files
setShowFiles(boolean)falseWhether to load Files for given suffixes
enableImageCapture(boolean)falseEnables camera for capturing of images
enableVideoCapture(boolean)falseEnables camera for capturing of videos
setCheckPermission(boolean)falseWhether to request permissions on runtime for API >= 23 if not granted
setSuffixes(String...)"txt", "pdf", "html", "rtf", "csv", "xml",
"zip", "tar", "gz", "rar", "7z","torrent",
"doc", "docx", "odt", "ott",
"ppt", "pptx", "pps",
"xls", "xlsx", "ods", "ots"
Suffixes for file to be loaded, overrides default value
setMaxSelection(int)-1Maximum no of items to be selected, -1 for no limits
setSingleChoiceMode(boolean)falseCan select only one file, overrides setMaxSelection(int)
use setSelectedMediaFile(MediaFile) to set default selection
setSelectedMediaFile(MediaFile)nullDefault file selection in singleChoiceMode
setSelectedMediaFiles(ArrayList<MediaFile>)nullDefault files to be marked as selected
setSingleClickSelection(boolean)trueStart selection mode on single click else on long click
setSkipZeroSizeFiles(boolean)trueWhether to load zero byte sized files
setLandscapeSpanCount(int)5Grid items in landscape mode
setPortraitSpanCount(int)3Grid items in portrait mode
setImageSize(int)Screen width/portraitSpanCountSize of height, width of image to be loaded in Px
setRootPath(String)External storageSet custom directory path to load files from
setIgnorePaths(String... ignorePaths)nullRegex patterns of paths to ignore
setIgnoreNoMedia(boolean)trueWhether to ignore .nomedia file
setIgnoreHiddenFile(boolean)trueWhether to ignore hidden file


How to use:
- Download all AAR and JAR from here https://www.dropbox.com/s/vg3k1zpnd89v8gw/LibAAR.zip?dl=1
(Too BIG for upload attachment)
- Use Appcompat library 4.0
- Add to Manifest :
B4X:
AddApplicationText(<activity
            android:name="com.jaiselrahman.filepicker.activity.FilePickerActivity"       >
        </activity>
    <activity
            android:name="com.jaiselrahman.filepicker.activity.DirSelectActivity"       >
        </activity>   
        
        )
- Config FilePickerConfigurations
- StartActivityForResult and wait for IOnActivityResult
- Please use example zip to start it!
 

Attachments

  • DemoFilePicker.zip
    13.3 KB · Views: 306

johnmie

Active Member
Licensed User
Longtime User
This is excellent, thank you ver much! in fact it is even much too powerful for my purposes.
My users receive a script in form of a *.csv file attached to an email and are requested to save the attachment which puts in the Download folder.
Thus we simply need only
  1. open the Download folder and show only *.csv files
  2. click on a file and get the real file name (not msf%123)
  3. in our app import that file (or copy to an accessible folder) and then delete it from the download folder
Which AARs,, Subs and variables do I need to accomplish this with firstApp (and what can I remove to reduce the footprint?)

Thank you for your help and best regards,
john m.
 
Top