Android NDK limitations?

前端 未结 4 1354
广开言路
广开言路 2021-02-05 12:13

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

4条回答
  •  佛祖请我去吃肉
    2021-02-05 12:50

    You can do pretty much anything you want in native code, but the only OS-level thing really supported is OpenGL, OpenSL, and some number-crunching libraries (compression, math, etc).

    However, at any time you're free to use the JNI to call a Java method, so you could use the standard Android API for networking (classes like Socket, etc). Obviously, since the call is going through the Java API, all the normal Android permissions apply (like android.permission.INTERNET).

    EDIT: As elaborated in the comments, the standard libraries that are part of the NDK do have support for sockets.

提交回复
热议问题