Touch Active Member Licensed User Longtime User Aug 22, 2014 #1 Hi, B4A implements a class to select a file? (native)
JohnD Active Member Licensed User Longtime User Aug 22, 2014 #2 There is a file class but it doesn't do file selection. Download the Dialogs library HERE. It should do what you want. Also check out THIS. Upvote 0
There is a file class but it doesn't do file selection. Download the Dialogs library HERE. It should do what you want. Also check out THIS.
Touch Active Member Licensed User Longtime User Aug 22, 2014 #3 I tried the dialog class, but using the theme Holo.light, the text color is same as background. It seems very strange that B4A not implement a native class for file selection. Upvote 0
I tried the dialog class, but using the theme Holo.light, the text color is same as background. It seems very strange that B4A not implement a native class for file selection.
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2014 #4 You can use ContentChooser to choose a file. There is no native file selector in Android. Upvote 0
Touch Active Member Licensed User Longtime User Aug 24, 2014 #5 Thanks Erel, this code select a file: Code: Dim cc As ContentChooser cc.Initialize("cc") cc.Show("*/*","Open File") but Code: Sub cc_Result (Success As Boolean, Dir As String, FileName As String) Dim nameFile As String 'in Globals Dim pathDir As String 'in Globals If Success = True Then nameFile = FileName pathDir = Dir End If End Sub does not return the desired result Upvote 0
Thanks Erel, this code select a file: Code: Dim cc As ContentChooser cc.Initialize("cc") cc.Show("*/*","Open File") but Code: Sub cc_Result (Success As Boolean, Dir As String, FileName As String) Dim nameFile As String 'in Globals Dim pathDir As String 'in Globals If Success = True Then nameFile = FileName pathDir = Dir End If End Sub does not return the desired result
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2014 #6 Android is not a file based OS. You are allowing the user to select anything. It can even be a resource that comes from a database. What do you need to do with the selected resource? Upvote 0
Android is not a file based OS. You are allowing the user to select anything. It can even be a resource that comes from a database. What do you need to do with the selected resource?
Touch Active Member Licensed User Longtime User Aug 24, 2014 #7 I have to open an excel file Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2014 #8 You have two options: 1. Get the path to media files returned from ContentChooser 2. You can always open an input stream to the path returned and then copy the file to a temporary location with File.Copy. Upvote 0
You have two options: 1. Get the path to media files returned from ContentChooser 2. You can always open an input stream to the path returned and then copy the file to a temporary location with File.Copy.
Touch Active Member Licensed User Longtime User Aug 24, 2014 #9 Thank you! I'll try the first solution! Upvote 0