[zeromq-dev] Zyre on Android (JNI)

Arnaud Loonstra arnaud at sphaero.org
Fri Jan 8 09:41:43 CET 2016


And this reminds me also to start working on a Pyre<>Zyre unittest...

Arnaud

On January 8, 2016 4:01:27 AM GMT+01:00, Sean Robertson <sprobertson at gmail.com> wrote:
>I was able to get the basic test working as well, but not receiving
>messages.
>
>In Activity.onCreate:
>
>node = new Zyre("test");
>node.start();
>node.join("testgroup");
>
>In a button onClickHandler:
>
>node.shouts("testgroup", "I am testing");
>
>This works perfectly, using Pyre I can read the shouted messages every
>time I click the button. But then if I try to receive a message on the
>Android side....
>
>Zmsg received = node.recv();
>
>W/linker  ( 5477): libzyrejni.so: unused DT entry: type 0x1d arg 0x973
>W/linker  ( 5477): libzyre.so: unused DT entry: type 0x1d arg 0xf11
>W/linker  ( 5477): libzmq.so: unused DT entry: type 0x1d arg 0xabbc
>W/linker  ( 5477): libczmq.so: unused DT entry: type 0x1d arg 0x3f23
>E/AndroidRuntime( 5477): FATAL EXCEPTION: Thread-16802
>E/AndroidRuntime( 5477): Process: com.sprobertson.ZyreTest, PID: 5477
>E/AndroidRuntime( 5477): java.lang.UnsatisfiedLinkError:
>dalvik.system.PathClassLoader[DexPathList[[zip file
>"/data/app/com.sprobertson.ZyreTest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.sprobertson.ZyreTest-1/lib/arm,
>/vendor/lib, /system/lib]]] couldn't find "libczmqjni.so"
>E/AndroidRuntime( 5477):        at
>java.lang.Runtime.loadLibrary(Runtime.java:366)
>E/AndroidRuntime( 5477):        at
>java.lang.System.loadLibrary(System.java:988)
>E/AndroidRuntime( 5477):        at
>org.zeromq.czmq.Zmsg.<clinit>(Zmsg.java:12)
>E/AndroidRuntime( 5477):        at
>org.zeromq.zyre.Zyre.recv(Zyre.java:173)
>E/AndroidRuntime( 5477):        at
>com.sprobertson.ZyreTest.MainActivity$2.run(MainActivity.java:74)
>W/ActivityManager( 1039):   Force finishing activity 1
>com.sprobertson.ZyreTest/.MainActivity
>
>Looks like it needs another .so included, "libczmqjni.so"?
>
>On Thu, Jan 7, 2016 at 8:48 AM, Pieter Hintjens <ph at imatix.com> wrote:
>> Yes, this API has gossip. The API matches the Zyre C API (it's
>> generated automatically from it).
>>
>> On Thu, Jan 7, 2016 at 5:43 PM, Utsav Drolia <utsavdrolia at gmail.com>
>wrote:
>>> Is the API the same as Jyre?
>>> From what I understand, Jyre did not have gossip when I started
>using it.
>>> Does this Android version of Zyre have it?
>>>
>>> On Jan 7, 2016, at 11:22 AM, Utsav Drolia <utsavdrolia at gmail.com>
>wrote:
>>>
>>> I developed some apps for my research using Jyre on Android. I can
>test
>>> those with Zyre and report results.
>>>
>>> On Jan 7, 2016 11:15 AM, "Pieter Hintjens" <ph at imatix.com> wrote:
>>>>
>>>> Next is to make a useful app; https://github.com/codejockey/canvas
>is
>>>> the one we're playing with, collaborative drawing.
>>>>
>>>> On Thu, Jan 7, 2016 at 3:19 PM, Arnaud Loonstra
><arnaud at sphaero.org>
>>>> wrote:
>>>> > On 2016-01-07 14:57, Pieter Hintjens wrote:
>>>> >> OK, so thanks to everyone for helping. The problem was due to
>how
>>>> >> Android looks for shared libraries; if the root .so needs to
>specify
>>>> >> its dependencies properly. This means adding a
>>>> >> target_link_libraries()
>>>> >> in the Cmake script.
>>>> >>
>>>> >> I've gotten Zyre to run on Android now; if anyone wants it, the
>jar
>>>> >> file is on https://github.com/zeromq/zyre/releases/tag/v1.1.0
>and the
>>>> >> scripts are in zyre/master.
>>>> >>
>>>> >
>>>> > Ow yeah, running a Zyre test on my mobile as we speak :)
>>>> >
>>>> > Great!
>>>> >
>>>> > Arnaud.
>>>> > _______________________________________________
>>>> > zeromq-dev mailing list
>>>> > zeromq-dev at lists.zeromq.org
>>>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>> _______________________________________________
>>>> zeromq-dev mailing list
>>>> zeromq-dev at lists.zeromq.org
>>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>>>
>>>
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>_______________________________________________
>zeromq-dev mailing list
>zeromq-dev at lists.zeromq.org
>http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-- 
Sent from my Hipster Android device with way too many features.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160108/9d04bb08/attachment.htm>


More information about the zeromq-dev mailing list