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.
You may like to read this also....
4 Comments to “how can I write applications in C or C++ for Android?”
Search in this website
- sagar on List of all standard version of c language
- Mohit Dhukia on How to access/unblock songs.pk in india?
- shinto peter on How to configure mail from localhost ( wamp ) using PHP?
- tammylleanne on Implementation limitation of c programming language
- Deepak on How to access/unblock songs.pk in india?
Find us on Facebook
Find us on stackoverflow
- Audio/video Recorder & player application based on MATLAB
- check dependency of your binary
- defination of all standard c programming language function
- Great Question-Answer on c programming
- know what your c code means
- Limition of c programming language
- List of all version of c programming language
- Online c compiler
- php freelancing work
- some more stuff on C programming language
- Volatile Keyword in Embedded System
- Write Android application in c language