Hi!!!! i am new for NDK. i want to know what is the benefit of native code in android . By this can we improve our application performance. and main thing exactly when we will use this native code. please clear it. and from where i can get more information............
+2
A:
The NDK allows you to write code using C/C++ and then link it into your Java application. You can potentially increase the speed of your application. However, it may be worth reading about Replica Island (http://code.google.com/p/replicaisland/), as they don't use the NDK, however achieve very fast frame rates.
The downsides to the NDK are, it only compiles to specific CPUs (whereas staying in Java land means it will work on any targetted version of Android).
Mark Ingram
2010-06-18 10:32:43
Thanks Mark..... from where i can get it's example???
Shalini Singh
2010-06-18 11:02:41
There are examples in the NDK folder when you download it
Donal Rafferty
2010-06-18 11:59:30
Yes thanks "Donal" i got :)...
Shalini Singh
2010-06-18 12:25:16
"Donal" i am trying to run ndk example on eclipse and following this link "http://mobilepearls.com/labs/ndk-builder-in-eclipse/" but when i am trying to set refresh tab property ,,on that place i didn't get lib folder . when i try to run my application ,, getting "java.lang.UnsatisfiedLinkError: Library helloneon not found" exception,,,,,, please guide me what is the problem....
Shalini Singh
2010-06-19 06:10:36
Do you *really* need to use the NDK..?
Mark Ingram
2010-06-19 08:44:18
yes, @Mark i have to work on ndk....
Shalini Singh
2010-06-19 08:53:48
@Mark, you mention compiling only on specific CPU's. Most have been ARM but many high end devices are using the new Qualcomm Snapdragon. Without thinking about it (since I don't have a phone yet) I ran a test out on a friends Droid Incredible without changing anything in the way I've been compiling (just with the stock NDK instructions and MAKE). It worked fine... I'd love an explanation as looking back, I'm thinking it shouldn't have worked.
Maximus
2010-06-24 02:26:05
@Maximus, the NDK supports two processors currently. The two supported devices are: * ARMv5TE (including Thumb-1 instructions) * ARMv7-A (including Thumb-2 and VFPv3-D16 instructions, with optional support for NEON/VFPv3-D32 instructions)(In the future it will support x86 too!)
Mark Ingram
2010-06-24 08:56:58
@Mark So here's where my inexperience shows through... any idea why it worked okay on the snapdragon (which of those it supports)?
Maximus
2010-06-25 01:48:02
By which of those, I mean which of those instruction sets...
Maximus
2010-06-25 05:36:55
@Maximus, the snapdragon is the second processor (ARMv7-A).
Mark Ingram
2010-06-25 13:04:46