[zeromq-dev] Setting an Android Device as a Subscriber
Areeb Mehmood
areeb.mehmood at renovomotors.com
Tue Jul 21 23:14:37 CEST 2015
Hello ZMQ,
Using Android Studio, and the jeromq-0.3.5.jar library, I am attempting to
build a mobile application that will subscribe to a publisher that is
dumping string messages.
Here is what my code looks like on the Subscriber side:
Runnable runnable = new Runnable()
{
public void run()
{
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket subscriber = context.socket(ZMQ.SUB);
subscriber.connect("tcp://192.168.1.36:6666");
String testcase = subscriber.recvStr(0);
TextView strDisplay = (TextView) findViewById(R.id.stringDisplay);
Log.i("Output", "the testcase recieved something");
strDisplay.setText(testcase);
Log.i("Output", "strDisplay was set");
}
};
The code hangs at:
String testcase = subscriber.recvStr(0);
I am not sure how to resolve this issue as I have tried various things. The
IP Address and Port are correct, and the publisher is running. I can also
provide the publisher side code if you need.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150721/2dbb798d/attachment.htm>
More information about the zeromq-dev
mailing list