Inspired by (and code used) from this thread...
https://www.b4x.com/android/forum/threads/filepicker.96795/
I needed an image picker to get camera photos when the user took pictures outside my app - but wants to include these camera images (one or more)... You can modify to choose any type of file. Scales to any device density.
xCustomListView is so powerful and I use it, more often than not for all new projects and UI classes.
This example starts by showing JPG or PNG files in the [DCIM/Camera] folder. It will load the first 20 images (or less) found in the folder.
Every selected image is added to a map (or de-selected - removed from map) - which is returned to the Wait For....
The Prev / Next buttons show the available (20) images...
The (back) ../Camera will allow to select a different directory.
Since each list item thumbnail is hard to view, clicking the imageview will show a larger image.
With a little work, please make this iOS usable and post your results...
Example Use:
Full Example project (and class) in attached zip...
https://www.b4x.com/android/forum/threads/filepicker.96795/
I needed an image picker to get camera photos when the user took pictures outside my app - but wants to include these camera images (one or more)... You can modify to choose any type of file. Scales to any device density.
xCustomListView is so powerful and I use it, more often than not for all new projects and UI classes.
This example starts by showing JPG or PNG files in the [DCIM/Camera] folder. It will load the first 20 images (or less) found in the folder.
Every selected image is added to a map (or de-selected - removed from map) - which is returned to the Wait For....
The Prev / Next buttons show the available (20) images...
The (back) ../Camera will allow to select a different directory.
Since each list item thumbnail is hard to view, clicking the imageview will show a larger image.
With a little work, please make this iOS usable and post your results...
Example Use:
B4X:
Sub sInputList_Show_Click
Log(" waiting here for result")
Wait For (imgFP.WaitForResult) Complete (Result As Map)
Log(" was waiting here - got result "&Result)
If Result.Size > 0 Then ' show images from map - or do what you want (like post to a server)
For i = 0 To Result.Size - 1
UpdIv(Result.GetValueAt(i), Result.GetKeyAt(i))
Sleep(3000)
Next
ToastMessageShow(" All Selected Images Were Shown",True)
Else
ToastMessageShow(" nothing was selected",True)
End If
End Sub
Full Example project (and class) in attached zip...
Attachments
Last edited: