BT

Call Native Code From Your Android Applications

| by Nicholas Nezis Follow 0 Followers on Jul 20, 2009. Estimated reading time: 1 minute |

Responding to requests from developers, the Android Native Developer Kit (NDK) supports (with release 1 of NDK 1.5) calling native code in the Dalvik virtual machine. CPU-intensive operations that don't allocate much memory may benefit from increased performance and the ability to reuse existing code. Some example applications are signal processing, intensive physics simulations, and some kinds of data processing.

The NDK is a suite of tools that enable developers to create native code executables and shared libraries.

The initial release is targeted towards Java application developers who wish to write native code shared libraries. The primary benefits would be in accessing native code APIs and accelerating portions of their application.

One of the first applications to use the NDK was a breakout style game made by the developer Aki. He modified his applications to switch from JBox2Dto Box2D. The performance of JBox2D under the Dalvik JVM seemed to suffer due to an increased amount of garbage collection. Using the native Box2D libraries, the application performed well with only a slight drop in frames per second as the application reached its limit of on-screen objects.

While the initial offering of Android NDK only supports a subset of the full Linux and Android APIs, there are plans to increase functionality. Examples include adding support for linking with OpenGL ES and audio libraries which should enable high-performance games.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT