C++ and Android

I need some guidance on how to make Android apps using C++. When I opened up Android Studio (IDE), I was hoping that it would be as easy as writing programs for Windows but all I could see was Java, many file types and files.
My best bet was to find some good book but doing a fast search I couldn't find any C++ Android Development book. Help?
Would this help?

qt-project.org


I found this not too long ago. It looks promising.

Here is a tutorial:

http://qt-project.org/doc/qtcreator-2.8/creator-android-app-tutorial.html
Last edited on
Roughly:

* Write an AndroidManifest.xml.
* Write a minimal Android activity. I think you can skip this if the program doesn't need a GUI or doesn't need any of the Android APIs. I'm not sure, though.
* Write Makefile(s) to build your project. If the project does use an activity, the C++ part will act as a library that's loaded by the Java bit and main() will be called from the JNI.
* Write your code and add your files to the Makefile.
* Build your project with the NDK, separately from the IDE.
* Deploy from the IDE (can also be done directly from command line using ADB.

The easiest way is to start from a skeleton project that you can modify to you needs. My project used SDL2, which provides such a skeleton.
You can take a look: https://github.com/Helios-vmg/CopperRat
The main source is under src/jni/src

Beyond the initial setup, most things are relatively straightforward. The C++11 compilers are feature-complete, but the standard library still somewhere between C++98 and C++11. My project even builds on both Windows and Android with very few platform-specific sections.

For questions specifically about Android development, you may have better luck at XDA Developers: http://forum.xda-developers.com/android/software
Last edited on
Helios is that project finished? Who is working on this with you? I really want to get into some open source development and I don't have a clue on how to start. I have made a couple android apps that do very little but I want to be involved in larger scale projects and yours looks interesting. Just looking at the c++ code alone, you seem to be using sfml, boost, and a lot of other other c++ libraries

@OP
Another referece (not that great at times so use stackoverflow):
http://developer.android.com/index.html
Last edited on
Topic archived. No new replies allowed.