I have a question about the limitations of what you can do in native code on the Android platform.
Basically I have developed a library in native C code that uses UDP so
You may like to check out csipsimple which is a example of using the pjsip sip library (which is written in C) in a java android application.
I haven't looked into how it does the sockets communication but it should give you a more complete example of what you are trying to do.