Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android UI in C++

I know this is kind of reinventing the wheel, but how hard would it be to implement an android user interface with C++? Is it hard to create things like buttons, and to handle touch screen events like button clicks? Is this feasible and if so, how would you go about doing it?

like image 294
HighLife Avatar asked Jun 03 '11 12:06

HighLife


2 Answers

Take a look at Necessitas, its a Qt port for android which seems to work pretty well.

It might still be in Alpha or Beta stage though, so it will depends on how "serious" your project is. But that proves for sure that one can use plain C++ to build a complete application, not only libraries.

like image 189
ereOn Avatar answered Sep 25 '22 01:09

ereOn


You can always use the JNI to go back up into java to get UI components on the screen. If you set it up to be little more than an API, you can simulate actually doing it in native code. NVidea has some good samples on how to do this: http://developer.nvidia.com/tegra-resources This library code isn't doing it for UI components, but is for various other things (sound, resources, etc). and the idea should work for UI components too.

Also, this project supposedly supports the entire sdk in c++, and I would imagine it's doing it the same way. I don't know how up to date it is, as I haven't actually used it: http://code.google.com/p/android-cpp-sdk/

like image 23
Leif Andersen Avatar answered Sep 22 '22 01:09

Leif Andersen