File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Developing for android using NDK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Developing for android using NDK" Watch "Developing for android using NDK" New topic

Developing for android using NDK

Ashley Riot

Joined: Nov 16, 2011
Posts: 25
Does the NDK provide all the tools and utilities that can be found in Java SDK? Is there an advantage to developing using the SDK instead of the NDK?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The NDK provides access to a small set of native libraries (, like OpenGL. And it has provisions for letting you implement methods in C/C++, going so far as making it possible to implement the entire lifecycle of an Activity in native code if you need to. It does not make available all the Java libraries to C code.
Jeffrey Friesen
Ranch Hand

Joined: Dec 29, 2012
Posts: 67

Hi Ashley,

A few months ago, I wrote about the Android NDK for Apress's "Android Recipes, Second Edition" book, which is being promoted on JavaRanch this week.

My NDK chapter (which also covers Renderscript) discusses NDK installation, explores the various tools that the NDK makes available, itemizes NDK examples that are part of the NDK, and provides sample programs. The first sample, NDKGreetings, presents the Java and C sides of what I'd call a hybrid app. The Java side loads a native NDKGreetings library and proceeds to invoke its getGreetingMessage() native method in the app activity's onCreate() method. The C side uses JNI to return a message from the native equivalent of getGreetingMessage(). Moving forward from this simple JNI demo, I present low-level and high-level native activities in the C language. I show how to create and run all of these examples in command-line and Eclipse IDE contexts. I believe this chapter (8) will answer your questions for you.

All the best.

Jeff Friesen
I agree. Here's the link:
subject: Developing for android using NDK
It's not a secret anymore!