Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Port/ Documentation #13

Open
GoogleCodeExporter opened this issue Aug 18, 2015 · 10 comments
Open

Android Port/ Documentation #13

GoogleCodeExporter opened this issue Aug 18, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

Looking for more documentation and any information on porting this to Android. 
Thanks!

Original issue reported on code.google.com by [email protected] on 23 Jan 2013 at 12:34

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 17 Apr 2014 at 4:01

@GoogleCodeExporter
Copy link
Author

Please make documentation and issue portal for running jCoAP on android,
@[email protected]::Did you find any solution to running the BasicCoapClient 
on android??

Original comment by [email protected] on 19 Jun 2014 at 5:53

@GoogleCodeExporter
Copy link
Author

Hi [email protected]:: 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 [email protected] on 19 Jun 2014 at 6:04

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Jun 2014 at 6:37

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Nope.. no changes in server side code. Are you seeing any error in logcat ? Or 
any specific observations during debugging?

Original comment by [email protected] on 19 Jun 2014 at 7:37

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Jun 2014 at 8:48

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Jun 2014 at 8:52

@GoogleCodeExporter
Copy link
Author

Ok...I think I should try it out on API 17 or above.Thank you.

Original comment by [email protected] on 19 Jun 2014 at 9:21

@GoogleCodeExporter
Copy link
Author

Yes....the minimum required API level for the library to work is API 17.Thank 
you.

Original comment by [email protected] on 19 Jun 2014 at 10:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant