B4i Library iQBImagePicker - Multiple selection image picker

CaptKronos

Active Member
Licensed User
Longtime User
I have updated to the latest B4i beta including wiping the Builder's Libs folder and all works well.
Just in case you are still confused about when you should use the Arm version:
If you use the simulator when developing and debugging, use the regular version of QBImagePicker and then when submitting your app to the App Store remember to compile using the Arm version. (Apple does not like submissions which include x86 binaries, which is what the simulator uses.)
If you never use the simulator, use the Arm version and then you won't need to remember to make the switch before submitting to the App Store.
 

ilan

Expert
Licensed User
Longtime User
hi again, so i just had the chance to try the demo from post 1. for some reason when i opened the demo i already got an error that QBImagePicker.load() had to many parameters.

this is what was in the demo:

B4X:
QBImagePicker.load(Page1,1,subType,True,0,10,0,0,True)

and i changed it to

B4X:
QBImagePicker.load(Page1,1,subType,True,0,10,0,0)

now i am a little bit skeptical that if this demo works for you that i have maybe the wrong lib?? why does the demo works for you while i get an error that there are to many parameters??

anyway, after trying to compile i get again the error that i am not able to compile. i am trying on a real device with the ARM file. (the one with about 300kb)
 

ilan

Expert
Licensed User
Longtime User


thank you so so much for your help, patient and lib. this is exactly what i needed to finish my project ?

everything works fine now on my iPhone11 running iOS14 beta !

put your paypal account here i want to buy you a beer
 

CaptKronos

Active Member
Licensed User
Longtime User
Don't worry about a donation. I should thank you for identifying all the problems with the release!
 

lymey

Active Member
Licensed User
Longtime User
Hi! can you ask Erel to add this to the hosted builder libraries. This won't work for people using the hosted builder servers. Many thanks!
 

CaptKronos

Active Member
Licensed User
Longtime User
To allow submissions to the App Store, I would suggest:

- Unzip iQBImagePicker-070720.zip (from the OP) into the folder "Libs" in the MAC HOSTED by AnywhereSoftware, normally in "B4i-MacServer\Libs" folder. This will result in iQBImagePicker.h, libiQBImagePicker.a and the folder QBImagePicker.framework being copied to the "Libs" folder.

- Now replace the file Libs\QBImagePicker.framework\QBImagePicker with the file QBImagePicker which can be found in QBImagePickerARM.zip (from the OP).
 

lymey

Active Member
Licensed User
Longtime User
Personally I am using the hosted builder and b4i bridge to test on a real device. I am guessing the QBImagePickerARM.zip
 

lymey

Active Member
Licensed User
Longtime User
Hi CaptKronos, when using the Hosted Builder service, a developer does not have access to the libraries folder. So to use a new library the code has to be uploaded by Erel. In this case, for a developer to use the QBImagePicker you have to tell Erel which Library it should be. I am guessing that for testing on a real device and later release, it has to be QBImagePickerARM.zip. I am really looking forward to using this!
 

CaptKronos

Active Member
Licensed User
Longtime User
Yep, my suggestion was aimed at Erel.
 

lymey

Active Member
Licensed User
Longtime User
Hi!
I am getting a nul url from
B4X:
Dim url As String=QBImagePicker.getImageURLFromAsset(assets.Get(0))
I amended this section of the example app:
B4X:
Sub qb_picked (assets As List )
    If assets.Size<>0 Then
     Log(assets.Get(0))
     theAssets=assets
        Dim url As String=QBImagePicker.getImageURLFromAsset(assets.Get(0))
        Log("url:" & url)
        url=url.SubString(7) 'convert to regular path and filename
        Log ("url substring: " & url)
     ImageView1.Bitmap=QBImagePicker.ConvertPHAssetToImage(assets.Get(0))
     Log ("Copy")
        QBImagePicker.CopyPHAssetToFile(assets.Get(0), "AcopiedFileName.jpg")
     pAsset=0
    End If
End Sub
Here is the log file:
 

lymey

Active Member
Licensed User
Longtime User
Hi! another question,
where does
B4X:
QBImagePicker.CopyPHAssetToFile(assets.Get(0), "AcopiedFileName.jpg")
copy the file to?
Many thanks, for getting this running on the Hosted Builder platform.
 

CaptKronos

Active Member
Licensed User
Longtime User
It will copy the file to whatever is the current folder. I would suggest that you explicitly state where you want the file saved:
B4X:
QBPicker.CopyPHAssetToFile(assets.Get(i), File.Combine(Folder, Filename))
 

CaptKronos

Active Member
Licensed User
Longtime User
Hi!
I am getting a nul url from
B4X:
Dim url As String=QBImagePicker.getImageURLFromAsset(assets.Get(0))
I amended this section of the example app:
Not sure why you are getting a nul url though I noticed you are trying to get a very large image. Perhaps try with a smaller one to start with?
Is QBImagePicker.CopyPHAssetToFile working for you?
 

CaptKronos

Active Member
Licensed User
Longtime User
Not sure why you are getting a nul url though I noticed you are trying to get a very large image. Perhaps try with a smaller one to start with?
Is QBImagePicker.CopyPHAssetToFile working for you?
If you put a breakpoint on your line
B4X:
Log("url:" & url)
you should be able to view the value of assets and within the values returned you should be able to find the directory and filename values. Are the values present for you?
 

lymey

Active Member
Licensed User
Longtime User
Yes, adding the explicit folder filename works. Thanks!
 

CaptKronos

Active Member
Licensed User
Longtime User
It would be nice to know why you are getting the nul URL but if you just need the filename and directory, the following (not tested) should work:

B4X:
Dim no As NativeObject=assets.Get(0)
Dim fn As String=no.GetField("_filename").AsString
Dim dir As String=no.GetField("_directory").AsString
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…