B4A Library [Class] File Explorer with visualization

Hi,

I created this class because I was frustrated by the File Dialog in the (great) Dialogs lib. With that class, you can customize everything (since you have the source code) and add new functions like rename, delete, create folder, etc.
Currently, the class can visualize picture and text files (or not if you set the option to false) when you select them.
You can make multiple selections.

If your activity contains a TabHost, loot at post #7.

Add this permission to the manifest for Android v4+:
AddPermission(android.permission.READ_EXTERNAL_STORAGE)


Since September 1st 2014, this class is completely free.

Enjoy,
Fred
 

Attachments

  • img1.jpg
    img1.jpg
    54.1 KB · Views: 3,564
  • img2.jpg
    img2.jpg
    68 KB · Views: 3,048
  • multi.png
    multi.png
    41.6 KB · Views: 2,853
  • FileExplorer v2.1.zip
    61.2 KB · Views: 2,366
Last edited:

Richard Peck

Member
Licensed User
Longtime User
Hi,

I just tried to display the /data directory and I'm being denied. I'm using SuperSU, and I added code to your program to
give it SU permission, but it still doesn't work. Is there some thing special I need to do?

Thanks
 

Informatix

Expert
Licensed User
Longtime User
Hi,

I just tried to display the /data directory and I'm being denied. I'm using SuperSU, and I added code to your program to
give it SU permission, but it still doesn't work. Is there some thing special I need to do?

Thanks
I never tried. Maybe you have to change the permissions on this folder to read it. Or maybe the API function does not allow to read the contents so you have to do a "ll" and parse the result. Try to find some help in the xda-dev forum. It's the right place for this kind of question.
 

MaxApps

Active Member
Licensed User
Longtime User
Hi Informatix

Is there a way to make the edittext accept a specific pattern (e.g. *.bmp), to make sure the name is correct for saving a file

Kind regards
Jakob
 

Informatix

Expert
Licensed User
Longtime User
Hi Informatix

Is there a way to make the edittext accept a specific pattern (e.g. *.bmp), to make sure the name is correct for saving a file

Kind regards
Jakob
The class does not include anything to check the extension, but you can easily add a test when the OK button is clicked. And much better: you could replace the EditText by a MaskedEditText, so you can filter what's typed when it is typed, or use a mask.
 

Fabrice La

Active Member
Licensed User
Longtime User
Hi

I having this when using the FileExploxer Example
raiseEvent for pnlsvtouch returned null
 

Fabrice La

Active Member
Licensed User
Longtime User
Start the project FileEplorer include in the 1st thread run as release (obfuscated) on my Galaxy3 Intl (Cyanogen 4.3.1). Click on Folders only and
raiseEvent for pnlsvtouch returned null
on the log ....
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello! I'm using fileexplorer-class 1.3 in my code, but it seems, that it is not possible to change the screenorientation when the explorer is open. I know, that it is always a problem with modal-dialogs, but it there a way to handle it?

Thanks for help...
 

hanyelmehy

Active Member
Licensed User
Longtime User
Hi,
when i try to use v1.3
nothing happened when i make click on any folder or file
please check code
B4X:
Sub Globals
    Dim dlgFileExpl As ClsExplorer
 
End Sub

Sub Activity_Create(FirstTime As Boolean)
    CreatFileExp
End Sub
Sub CreatFileExp

    dlgFileExpl.Initialize(Activity, "/mnt/sdcard", "", True, False, "OK")
    dlgFileExpl.DialogRect.Left = 5dip
    dlgFileExpl.DialogRect.Right = 100%x - 10dip
    dlgFileExpl.DialogRect.Top = 5dip
    dlgFileExpl.DialogRect.Bottom = 100%y-60dip
    dlgFileExpl.BackgroundColor = Colors.LightGray
    dlgFileExpl.BorderColor = Colors.RGB(128, 128, 128)
    dlgFileExpl.FolderTextColor = Colors.Black
    dlgFileExpl.FileTextColor1 = Colors.Blue
    dlgFileExpl.FileTextColor2 = Colors.White
    dlgFileExpl.DividerColor = Colors.Gray
    dlgFileExpl.Explorer
    If Not(dlgFileExpl.Selection.Canceled OR dlgFileExpl.Selection.ChosenFile = "") Then
        Msgbox("File:" & CRLF & dlgFileExpl.Selection.ChosenPath & "/" & dlgFileExpl.Selection.ChosenFile, "Your choice")
    End If
   
   

End Sub
Sub Activity_Resume
   
End Sub

Sub Activity_Pause (UserClosed As Boolean)
   
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
    If dlgFileExpl.IsInitialized Then
        If dlgFileExpl.IsActive Then Return True
    End If
End Sub
 

Informatix

Expert
Licensed User
Longtime User
Hi,
when i try to use v1.3
nothing happened when i make click on any folder or file
please check code
B4X:
Sub Globals
    Dim dlgFileExpl As ClsExplorer

End Sub

Sub Activity_Create(FirstTime As Boolean)
    CreatFileExp
End Sub
Sub CreatFileExp

    dlgFileExpl.Initialize(Activity, "/mnt/sdcard", "", True, False, "OK")
    dlgFileExpl.DialogRect.Left = 5dip
    dlgFileExpl.DialogRect.Right = 100%x - 10dip
    dlgFileExpl.DialogRect.Top = 5dip
    dlgFileExpl.DialogRect.Bottom = 100%y-60dip
    dlgFileExpl.BackgroundColor = Colors.LightGray
    dlgFileExpl.BorderColor = Colors.RGB(128, 128, 128)
    dlgFileExpl.FolderTextColor = Colors.Black
    dlgFileExpl.FileTextColor1 = Colors.Blue
    dlgFileExpl.FileTextColor2 = Colors.White
    dlgFileExpl.DividerColor = Colors.Gray
    dlgFileExpl.Explorer
    If Not(dlgFileExpl.Selection.Canceled OR dlgFileExpl.Selection.ChosenFile = "") Then
        Msgbox("File:" & CRLF & dlgFileExpl.Selection.ChosenPath & "/" & dlgFileExpl.Selection.ChosenFile, "Your choice")
    End If
  
  

End Sub
Sub Activity_Resume
  
End Sub

Sub Activity_Pause (UserClosed As Boolean)
  
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
    If dlgFileExpl.IsInitialized Then
        If dlgFileExpl.IsActive Then Return True
    End If
End Sub
I think that you are in the same case as above. Read post 50 and 51.
 

hanyelmehy

Active Member
Licensed User
Longtime User
Hi,
can you please send last version
i send small donation :Confirmation number: 3M05052548462754T
 
Top