Search Unity

Blackberry plugins?

Discussion in 'BlackBerry' started by EvilDingo, Aug 6, 2013.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    Hmm I don't have control over that, the tool used to set the price only lets me set US Dollars, I can't set conversion rates.
    If its a concern to you, I suggest talking to the Unity folks about it, maybe there is something wrong in there system.
     
  2. SpacePixel

    SpacePixel

    Joined:
    May 16, 2013
    Posts:
    32
    That's a shame, does seem a tad unfair but hopefully they can look into it. Looks a great asset though and I'll be grabbing it later today.
     
  3. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    Hey guys,

    I was able to get a project working that was using bbmsp. I compiled it like this:
    arm-unknown-nto-qnx8.0.0eabi-g++ -fPIC -marm -L<Path To your BlackBerry SDK>/target_10_2_0_1155/qnx6/armle-v7/usr/lib/qt4/lib -lQtCore -lbbmsp -shared <sourcefile name>.cpp -o <your shared library name>.so

    So I linked against the QtCore lib there. Next it gets a little tricky. What you need to do is modify the bar-descriptor.xml in the StagingArea directory because it defines the LD_LIBRARY_PATH that the app runs with.

    <env var="LD_LIBRARY_PATH" value="$LD_LIBRARY_PATH:app/native/lib"/>
    To make it say:
    <env var="LD_LIBRARY_PATH" value="$LD_LIBRARY_PATH:app/native/lib:/usr/lib/qt4/lib"/>

    After that you can repackage the application using the command line tools and deploy using the command line tools. I plan on adding a feature (hopefully soon) that will allow users to modify the LD_LIBRARY_PATH and add additional libraries to it.
     
  4. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
  5. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Has anybody had any look making a plugin that can call functions in the bb namespace?

    I am trying to create a simple Shared Library and I can get it to compile only if I don't add any functions form the bb or Q namespaces. For example I want to use InvokeManager, but when I do that it complains of QtGlobal, no such file or directory.

    I've seen comments about editing the PO file, but when you just create a shared library none of that even gets created. You just have a hidden .project file and the CPP and MAK files.

    This has been driving me nuts for hours :(
     
  6. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    You can't link to QT libs. Its the biggest issue with making plugins for BB10. You can ONLY use Core Native C APIs.
     
  7. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Ah, that explains why I've spent 3 hours getting nowhere then.

    Thanks for confirming that. I will look at the Core API instead.
     
  8. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Almost there now. Just can't seem to get it to call the functions in my library.

    I have a CPP file that is compiled to libMyPluginso and placed into Plugins/Blackberry/libs. It contains a number of functions that return ints and take char *strings as parameters.

    I have written the C# wrapper class for them and declared access to the functions as follows:

    [DllImport("MyPlugin", EntryPoint="_MyTestFunction", CharSet=CharSet.Auto)]
    private static extern int _MyTestFunction(string message);

    However, when running on the device, the call to this function always throws the following Exception:

    DllNotFoundException: MyPlugin

    I can't see what I am doing wrong here. I have tried removing the EntryPoint option but it makes no difference at all.

    Anyone any ideas?
     
  9. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    Don't make or compile a native BB10 .so lib file yourself. This is pointless when working with the Core Native APIs as they are all C methods anyway.
    You will just create more trouble then its worth. DllImport directly into the Core Native APIs instead.
     
  10. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    I'm not sure I understand that answer, sorry.

    I have written a straight CPP file with three simple functions inside an extern C function block. These functions call lots of native library methods to do their tasks and use native c parameters. I need to be able to call these function blocks I have written from C#.

    Am I missing something?
     
    Last edited: Mar 6, 2014
  11. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    I was suggesting if you are trying to call Core Native APIs, then its best to just invoke them via C#.

    If you are writing a C/C++ lib for other reasons:
    1) Did you put your compiled .so file in "Assets/Plugins/BlackBerry/libs/..." ?
    2) You don't need to set "CharSet=CharSet.Auto"
    3) Make sure you build as release.
     
  12. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253