Open GoogleCodeExporter opened 9 years ago
Not able to run BasicCoapClient on android. Coap Server is hosted on a laptop
in the same wireless network. Need more documentation for the same.
Original comment by gogi.no...@gmail.com
on 17 Apr 2014 at 4:01
Please make documentation and issue portal for running jCoAP on android,
@goog1.no..@gmail.com::Did you find any solution to running the BasicCoapClient
on android??
Original comment by NITIN.JA...@gmail.com
on 19 Jun 2014 at 5:53
Hi NITIN.JA...@gmail.com:: Yes I was able to run it on android. For my demo, I
did the following steps:
- Inside onStart() method of my activity, I connected to the server using
CoapChannelManager API.
CoapChannelManager channelManager = BasicCoapChannelManager.getInstance();
clientChannel = channelManager.connect(....) ;
- Inside one of the listeners of a UI component, I created and sent the request
over the channel acquired in onStart.
CoapRequest coapRequest = clientChannel.createRequest(true,
CoapRequestCode.GET);
coapRequest.set.... // Multiple set statements
clientChannel.sendMessage(coapRequest);
- Add permission for INTERNET access in you android manifest. This is what I
missed actually when I posted my last comment. After debugging, I found the
issue :)
<uses-permission android:name="android.permission.INTERNET" />
Original comment by gogi.no...@gmail.com
on 19 Jun 2014 at 6:04
Thanks for taking time off to reply, but it does not seem to do the trick for
me, did you tweak anything on the BasicCoapServer code?
Original comment by NITIN.JA...@gmail.com
on 19 Jun 2014 at 6:37
[deleted comment]
Nope.. no changes in server side code. Are you seeing any error in logcat ? Or
any specific observations during debugging?
Original comment by gogi.no...@gmail.com
on 19 Jun 2014 at 7:37
No error in logcat...
Observations:
I found out that the the message to be sent is getting added to the sendBuffer
in the BasicCoapSocketHandler but the sendBufferedMessages() method is not
getting called...from the WorkerThread
Which version of android were you testing on by the way?
Original comment by NITIN.JA...@gmail.com
on 19 Jun 2014 at 8:48
I used API level 19 during design time. At runtime, my device is android 4.4.
It worked even in 4.3.
Original comment by gogi.no...@gmail.com
on 19 Jun 2014 at 8:52
Ok...I think I should try it out on API 17 or above.Thank you.
Original comment by NITIN.JA...@gmail.com
on 19 Jun 2014 at 9:21
Yes....the minimum required API level for the library to work is API 17.Thank
you.
Original comment by NITIN.JA...@gmail.com
on 19 Jun 2014 at 10:22
Original issue reported on code.google.com by
mjonesj...@gmail.com
on 23 Jan 2013 at 12:34