Call C++ library from Java in Android

前端 未结 4 997
故里飘歌
故里飘歌 2020-12-28 08:54

Is it possible to call a C++ library from an Android app? If yes, how?

I have zero experience in Android programming (some Java programming experience though) but I

4条回答
  •  星月不相逢
    2020-12-28 09:21

    Yes you can. As previous posters mentioned you build your C++ library using the NDK and use JNI to call it from Java

    If you're planning to make several C++ classes accessible you can use SWIG to automatically generate the JNI layer for you

    http://www.swig.org/index.php

提交回复
热议问题