- LG Optimus One Gingerbread update now available
- How can I get what my main function has returned in Linux?
- Chetan Bhagat’s fifth novel “Revolution 2020” launched on 8 Oct 2011,Book Summary,Buy online,Read Review,Book-Price
- How to read system command output from Console In C
- Top/Best C/C++ IDE for Windows & Linux
Most of the people know that Development of Android Application is only done in java programming language. But Reality is that Development of Android application can be done in native languages like C & C++.
I have 3 option to do this all.
1> For doing this You need to use Android NDK
The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.
Now To start Follow this step :
- Download & Install Google Android NDK. It contains libs, headers, makfile examples and gcc toolchain
- Build an executable from your C code for ARM, optimize and link it with provided libs if required
- Connect to a phone using provided adb interface and test your executable
If you are looking to buy an app:
- Build a library from your C code
- Create simple Java code which will use this library
- Embed this library into application package file
- Test your app
- Buy it or distribute it for free
2> Another option to Android NDK is
MoSync makes it easy, fun and cost efficient to develop mobile application for all the major platforms. Using C++ and a set of powerful APIs, you can harness the full power of modern smartphone platforms while still supporting Java ME devices using a single codebase.
In short MoSync SDK is for cross platform mobile development.
Download its current release from here.
3> Once more option is do this is
Binary translation for Java
NestedVM provides binary translation for Java Bytecode. This is done by having GCC compile to a MIPS binary which is then translated to a Java class file. Hence any application written in C, C++, Fortran, or any other language supported by GCC can be run in 100% pure Java with no source changes.
Here you can use nestedvm to translate C into Java bytecode, and use that as the basis of your port. For example, see the Android port of Simon Tathams portable puzzle collection.
Finally i want to share my personal thought about using native language in Android. Using native code does not result in an automatic performance increase, but always increases application complexity.
Please also read.