Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any experience with Android NDK?

I'm specifically interested in how portable it is between various phones. We have an application with some computation heavy code we'd like to share between Android and iPhone. If we could write it in C, we'd have a single code-base, but if the NDK only supports a subset of the processors that phone manufacturers are creating, or if we have to recompile for each processor, that's not a workable solution.

Thanks for any experiences with it.

like image 626
john146 Avatar asked Nov 06 '09 22:11

john146


People also ask

What is Android NDK used for?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

Which is better NDK or SDK?

You really should use SDK, unless you have a good reason to use NDK. Good reasons may vary, but for example, you could use NDK: If you want to use OpenGL ES 2.0 for Android 2.1 (Eclair), it is only avaiable through NDK.

What is difference between Android NDK and SDK?

Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java. [TODO] more. NDK is a complex and advanced topics.

How do I know if Android NDK is installed?

With a project open, click Tools > SDK Manager. Click the SDK Tools tab. Select the NDK (Side by side) and CMake checkboxes. Note: If you have an NDK installed in the ndk-bundle folder, it appears in the list with the label NDK.


2 Answers

On the subject of whether all Android (version 1.5+) phones will support the output of the current NDK:

All I can say is there's nothing in the documentation to suggest otherwise (unless perhaps if you read an implication in "this release supports the ARMv5TE instruction set"), and I follow Android news fairly closely and haven't heard of any Android phones being released using a non-ARM architecture (though some people hacked together a build for EeePC). Looking at the Android source, there are traces of only one other platform, x86. As for the future plans of Google and the OHA? You'd have to ask them. They recently announced some developer days, but probably all the spots are gone now (the first one is today). I registered pretty early for the London day (17th) so if I get in I'll try to get an answer there (I'm keen to know definitively too).

like image 160
Chris Boyle Avatar answered Sep 24 '22 23:09

Chris Boyle


I am not very familiar w/ Iphone development, but if you look on the android ndk page, under the development tools section, it lists the guaranteed headers available in the platform, so if the iphone supports these functions, or you can create interfaces between your code and the native libraries on both platforms than I don't see why it wouldn't work.

like image 21
broschb Avatar answered Sep 22 '22 23:09

broschb