Program for Android in C/C++ with the Native Development Kit (if you dare)
来源:互联网 发布:南京大学软件学院考研 编辑:程序博客网 时间:2024/04/30 19:09
http://www.zdnet.com/blog/burnette/program-for-android-in-cc-with-the-native-development-kit-if-you-dare/1284
Not a big fan of Java? Well, get over it, because that’s the primary and recommended way to write applications for Android devices. It’s portable and… what’s that? Android’s Dalvik Java VM not fast enough for you? Granted, it’s an interpreted engine and as of version 1.5 there’s no Just-In-Time compiler. But Dan promises… oh, can’t wait for the JIT to come out? Ok, ok, we’ll let you program in C if you’re really sure.
Introducing the Android Native Development Kit (NDK). With it, you can implement *parts* of your application using native-code languages such as C and C++. You’re familiar with the Java Native Interface (JNI), right? JNI lets you load a shared library and call C code from within Java. The NDK lets you compile and build those libraries for the ARM CPU chip used in all *current* Android devices.
The NDK provides:
- A set of tools and build files used to generate native code libraries from C and C++ sources
- A way to embed the corresponding native libraries into application packages files (.apks) that can be deployed on Android devices
- A set of native system headers and libraries that will be supported in all future releases of the Android platform, starting from Android 1.5
- Documentation, samples, and tutorials
Users downloading your program from the Market will not be able to tell whether or not you used native code. In fact, some apps already on the Market use it. However, native code is not for everyone. Google engineer David Turner writes:
Keep in mind that using the NDK will not be relevant for all Android applications. As a developer, you will need to balance its benefits against its drawbacks, which are numerous! Your application will be more complicated, have reduced compatibility, have no access to framework APIs, and be harder to debug. That said, some applications that have self-contained, CPU-intensive operations that don’t allocate much memory may still benefit from increased performance and the ability to reuse existing code. Some examples are signal processing, intensive physics simulations, and some kinds of data processing.
You have been warned. Stay away from the NDK unless you really need it. Try optimizing your Java code first. Try profiling. Acupuncture, cold compresses, anything but… what did you say? “Shut the…,” hey, there’s no need to be rude. Have at it.
- Program for Android in C/C++ with the Native Development Kit (if you dare)
- android native c development
- Android Native Development Kit (NDK)
- Android C native development using the NDK under Windows
- Love me if you dare
- burberry factory outlet If you have a special respect for the clothes you wear plus the brands you c
- 初识 Android Native Development Kit (NDK)
- Android NDK 环境搭建(Native Development Kit )
- Android NDK: Native Development Kit 入坑篇
- building c program with libsocket in ubuntu
- C program for stack with array implementation
- iPhone Open Application Development: Write Native Objective-C Applications for the iPhone
- Android Native C development (1) -- Env Setup
- Android Native C development (2) -- framebuffer
- Android Native Development Kit Cookbook 中 第二章 Manipulating strings in JNI代码错误问题
- You Can Program in C++: A Programmer's Introduction
- You Can Program in C++: A Programmer's Introduction
- Android Native Coding in C
- 模板类和友元函数
- Oracle数据库的锁
- ASP实现记住密码的功能
- ASP实现隐藏下载地址和防盗
- 关于几种并发模型可能造成的副作用的读后感
- Program for Android in C/C++ with the Native Development Kit (if you dare)
- SQL Driver Java
- 善学则进
- 谷歌街景车遭巴黎隐私保护机构检查
- C++ 构造函数和析构函数的继承
- 程序员须知 收包与发包
- SilverLight + Html + JavaScript
- asp.net 架构
- 关于The status code returned from the server was:500的解决