ndk calling sdk

78 lượt xem
Chuyển tới thư đầu tiên chưa đọc

techxpl...@gmail.com

chưa đọc,
12:00:25 27 thg 3, 201727/3/17
đến android-ndk
Hi,

Would it be possible to call Android SDK from NDK through JNI?
Tried to lookup but failed to find any information.

Any advice is appreciated.
Bài viết đã bị xóa

Gerry Fan

chưa đọc,
13:00:44 27 thg 3, 201727/3/17
đến android-ndk
Personally I do not know the direct way calling SDK API from NDK via JNI.  Sample creates Java side functions, which call SDK functions; from NDK function, sample call into the Java side function.  Teapot has the trick[JNIHelper, NDKHelper.java etc], hello-jniCallback just to show how to set up NDK --> Java SDK side communication [calling Java private functions from JNI is not recommended though]

voks

chưa đọc,
09:57:25 28 thg 3, 201728/3/17
đến android-ndk
You can do this. Just need to use proper class/func/signature which sometimes not easy to know. Also you have to take care about return value, exceptions and threads of cause.
The solution in prev answer is much easier to do.

s.rawat

chưa đọc,
12:04:38 29 thg 3, 201729/3/17
đến android-ndk
you can call into java from ndk(no idea if you can call directly from ndk to sdk APIs). So if it is acceptable to call into Java from ndk  , you can create a wrapper which in turn will call the SDK APIs from the java code.

On Tue, Mar 28, 2017 at 7:27 PM, voks <vok...@gmail.com> wrote:
You can do this. Just need to use proper class/func/signature which sometimes not easy to know. Also you have to take care about return value, exceptions and threads of cause.
The solution in prev answer is much easier to do.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/adcf3efd-8b4e-414c-bf4f-de99f1643a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Trả lời tất cả
Trả lời tác giả
Chuyển tiếp
0 tin nhắn mới