B4i Library Photo Browser Library

Hey Everybody,

I am pleased to publish a library that will allow you to show an image/photo browser.

All you have to do in your code is to use the photo browser object, pass it the list of urls(can be local or remote) and call the Show method, passing in your NavControl object. The photo browser takes care of downloading the images, caching, swipe to view next/previous, zooming etc. It also has a built-in action button that lets you share the images.

As much as I'd like to take credit for this, the real credit should to Michael Waterfall, the author of the wonderful MWPhotoBrowser library. I just sweated over creating the B4i wrapper :)

I'm copying a link to the library zip as it's a little over the limit (800kb) to attach here. The two library archives(.a files) and the header file(.h file) you need to copy to your local mac builder's Libs directory. If you're using hosted builder, you will not be able to use it unless B4i overlord(Erel) takes the library source from me and decides to add it to base.

You also need to copy the .xml file to your B4i installations libraries directory.

A sample project is also attached here.

The library as it stands is fairly basic. It doesn't currently support any callbacks(events) but I will look into adding some as and when required.

Link:

https://drive.google.com/file/d/0ByDFbtVDbyXZeEM4SkdiYXkzVlU/view?usp=sharing

Have fun!

Harris.
 

Attachments

  • PhotoViewer.zip
    2.8 KB · Views: 118

narek adonts

Well-Known Member
Licensed User
Longtime User
got the following error

B4X:
duplicate symbol _OBJC_CLASS_$_MBBarProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_CLASS_$_MBProgressHUD in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_CLASS_$_MBRoundProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._lineColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progressColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progressRemainingColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.animationType in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.color in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.completionBlock in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.customView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.delegate in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabel in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabelFont in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabelText in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.dimBackground in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.graceTime in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.graceTimer in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.indicator in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.isFinished in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.label in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.labelFont in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.labelText in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.margin in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.methodForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minShowTime in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minShowTimer in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minSize in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.mode in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.objectForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.opacity in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.removeFromSuperViewOnHide in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.rotationTransform in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.showStarted in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.size in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.square in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.targetForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.taskInProgress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.useAnimation in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.xOffset in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.yOffset in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._annular in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._backgroundTintColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._progressTintColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBBarProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBProgressHUD in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBRoundProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
ld: 49 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 

Haris Hafeez

Active Member
Licensed User
Longtime User
got the following error

B4X:
duplicate symbol _OBJC_CLASS_$_MBBarProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_CLASS_$_MBProgressHUD in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_CLASS_$_MBRoundProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._lineColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progressColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBBarProgressView._progressRemainingColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.animationType in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.color in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.completionBlock in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.customView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.delegate in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabel in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabelFont in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.detailsLabelText in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.dimBackground in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.graceTime in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.graceTimer in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.indicator in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.isFinished in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.label in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.labelFont in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.labelText in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.margin in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.methodForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minShowTime in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minShowTimer in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.minSize in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.mode in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.objectForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.opacity in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.removeFromSuperViewOnHide in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.rotationTransform in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.showStarted in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.size in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.square in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.targetForExecution in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.taskInProgress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.useAnimation in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.xOffset in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.yOffset in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._annular in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._backgroundTintColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._progress in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._progressTintColor in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBBarProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBProgressHUD in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
duplicate symbol _OBJC_METACLASS_$_MBRoundProgressView in:
    ../../Libs/libMWPhotoBrowser.a(MBProgressHUD.o)
    ../../Libs/libiDebug.a(MBProgressHUD.o)
ld: 49 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Are you using local builder or hosted?
 

Haris Hafeez

Active Member
Licensed User
Longtime User
I came across this issue on my local builder but fixed it before releasing the library files.
I will look into it when I get back home this evening and revert.
 

Haris Hafeez

Active Member
Licensed User
Longtime User
Hey guys,

So I just looked into it and we've got an interesting issue to resolve. If you build the sample app in release mode (or your app) with the photo browser library, you will not face any issues. But if you build it in debug mode, you will get the error you reported.

The issue is because when I was developing the B4i wrapper for the MWPhotoBrowser library, I realized that there is a conflict with an internal library of B4i, called iDebug. iDebug relies on MBProgressHUD to present the progress dialog while we are debugging an app. This class is also used internally by the MWPhotoBrowser library to present progress dialogs. So when I was building my app in debug, I was getting the above reported conflict. In order to resolve the conflict at debug time, I compiled the MWPhotoBrowser library without the header file that containes MBProgressHUD related classes. This resolved the issue for debug.
The story didn't end there unfortunately. When I compiled for release, I got an error where the compiler complained that the linked library MWPhotoBrowser did not have the said interfaces declared. So to fix this I added the MBProgressHUD.h back to the MWPhotoBrowser library, and the release worked perfectly.

The short story is that it seems quite complex to resolve this issue. This is because when we compile for release, classes in iDebug.a do not end up in our apps(this is what I believe happens) so the linker cannot find the MBProgressHUD classes which in debug mode were provided by iDebug.a library. So what I have done myself now is to have two versions of the MWPhotoBrowser library(.a files): one that I use for debug and the other that I use for release.

I understand that this solution sucks as far as technical grace goes. Its ugly and will not work with hosted builders. I have a few solutions in mind and am open to discussing them and working on them with you guys, :

  1. Build a debug version of the library that you will use in your project while debugging but switch to the release version when you want to release the app. So you will have an HHPhotoBrowser-Debug and HHPhotoBrowser-Release available in your B4i IDE and you use the one depending on your deployment cycle. An ugly solution in my opinion but hey, we're dealing with a dog of a situation here :)
  2. Use a local mac builder and swap/replace the debug version of the libMWPhotoBrowser.a file depending on whether you are compiling for debug. So in your mac builder's lib folder, you will have two libMWPhotoBrowser.a files, with one named -debug.a and the other just named libMWPhotoBrowser.a. Again an ugly option.
  3. I will try to work on creating a wrapper for another photo browser library but this photo browser in my opinion is the best and the most widely used in my research.
  4. The final I can think of is for asking Erel to help us out with this :) Perhaps he can find a way to conditionally load the MBProgressHUD related classes from the iDebug.a if required? Not sure.
I am attaching a version of libMWPhotoBrowser.a Please rename it so you remove the -DEBUG from the name and use it in your local mac builder when you build for debug. Later, when you want to buld for release, you should copy the original libMWPhotoBrowser.a and save the debug version by renaming it again -DEBUG. Yuck....

Let me know how you guys get along and let's try to find a solution.

Link to library that you can use in debug:

https://drive.google.com/file/d/0ByDFbtVDbyXZamRta3hXd2thcW8/view?usp=sharing

Best,
Harris.
 
Last edited:

little3399

Active Member
Licensed User
Longtime User
Hi, Harris
Dose this Library can support the loca folder files which in File.DirAssets ? TKS!
 

little3399

Active Member
Licensed User
Longtime User
Hi, Haris
I using file://urls , but It seem not to work ? here was my code file ... and your any suggestion ?
 

Attachments

  • B4iTest.zip
    7.7 KB · Views: 16

Haris Hafeez

Active Member
Licensed User
Longtime User
Hi, Haris
I using file://urls , but It seem not to work ? here was my code file ... and your any suggestion ?
I'm afraid your B4I code isn't correct. You're not using the File object properly.
This line: out = File.OpenOutput(File.DirDocuments&DirName, FileName, False) in SavePictureToFile is not correct. Basically, you should do something like this:
B4X:
    out = File.OpenOutput(File.DirDocuments, FileName, False)

I recommend reading up a bit on using the File object :)
 

little3399

Active Member
Licensed User
Longtime User
Hi, Haris

Thank for you suggestion, but my photo is save in these directory structure... so my b4i code should be correct ...
So I'm not sure whether photos library browser can support the directory structure? Tks!
 

Attachments

  • upload_2015-6-23_7-39-13.png
    upload_2015-6-23_7-39-13.png
    89.4 KB · Views: 50

Haris Hafeez

Active Member
Licensed User
Longtime User
I am not sure I follow. The app crashed when I tested it at the line where it tries to open the output stream.

Anyways, back to your main question. The library currently does have some issues with the file:// url. This is related to B4i library development and I am currently working on finding the best way forward for this and other libraries that depend on local files.
I haven't uploaded an updated library because I want to work on the recommended way for working on a File that works both in DEBUG and RELEASE. If you're using local builder, I may be able to send you an updated library.

To read more on the subject, please refer to this link.
 

little3399

Active Member
Licensed User
Longtime User
I had been setup the debug library of PhotoBrowser ... and update your update lib on #7 post ...

upload_2015-6-23_9-50-25.png
 
Last edited:

Haris Hafeez

Active Member
Licensed User
Longtime User
I will update the library here to help with the local files issue (hopefully tonight) when I get back from (paid) work :)
 

Haris Hafeez

Active Member
Licensed User
Longtime User
I have updated the library so it now works well with local image assets. Note that you will have to pass in Bitmap objects if you want to show local images.

The updated library files can be downloaded here.

Using local files:
B4X:
Sub ShowImage
    Dim l As List: l.Initialize
    Dim b As Bitmap = LoadBitmap(File.DirAssets, "audio_icon_default_gd.png")
    l.Add(b)
    b = LoadBitmap(File.DirAssets, "audio_icon_default_od.png")
    l.Add(b)
    b = LoadBitmap(File.DirAssets, "audio_icon_default_db.png")
    l.Add(b)
   
    Dim pv As HHPhotoBrowser
    pv.Initialize2("pv", l)
    pv.SetCurrentPhotoIndex(1) 'start from the second photo in the list
    pv.Show(NavControl)
End Sub
 

little3399

Active Member
Licensed User
Longtime User
Hi, Haris
Thanks for your good library ... but I want to adding some function about this library ,
1. Does can add the photo describe
2. return the CurrentPhotIndex ...

Tks!
 

Attachments

  • 20150627124216.png
    20150627124216.png
    353.2 KB · Views: 68

Haris Hafeez

Active Member
Licensed User
Longtime User
I can certainly do it :) Only that finding a bit of spare time is getting a bit challenging. I will try to find some time tonight (or this week) and update.

Note that choosing a photo will require you to implement a custom action. I will change the library (at least that's the plan) to raise an event when the action button is clicked. You will have to implement the action yourself.
 
Top