O
O
Oleg Savchuk2016-07-02 15:42:58
Android
Oleg Savchuk, 2016-07-02 15:42:58

Programming for Android in C/C++?

Good afternoon. Interested in this topic. Prior to that, he programmed exclusively for Windows in C/C++ + DirectX to develop simple 3D games. There is development experience, mat. part too. But I would like to find myself in something new, for example, in development for Android. Android itself is close to me, because the device is under this OS, but I did not write anything like it for it. Java is alien to me, I do not digest it (Javists, do not immediately throw tomatoes). So, the main question that interests me is: is it possible to write for Android without resorting to Java code (the same Android NDK)? If so, what kind of literature would you recommend (English / Russian)? And what will I get from using only C/C++, besides the complexity of the implementation? For me, it is important, in general, is the speed of the application and minimizing the use of system resources.
I plan to develop applications with great computing functionality: scientific applications, complex 3D games with a huge number of mathematical and physical calculations.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexey Perelygin, 2016-07-04
@orcDamnar

I tend to believe that a programmer who does not tolerate one or another programming language is not yet a programmer enough. Language is a tool. In general, you can make applications on the NDK, look at the NativeActivity line - you get an entry point, and then do what you want in C / C ++. But I wouldn't hammer nails with a microscope. When developing in pure C / C ++ for android, you will have to do all the UI that is already in the standard SDK with your own hands ... Maybe you can do better, but there will always be a question of who needed it?

D
Dmitry Alexandrov, 2016-07-02
@jamakasi666

The Android NDK is very poorly documented. We must take into account that the processors are different (armeabi armeabi-v7a x86) and there are small discrepancies (a little information here ). It is also necessary to take into account that it is better to write and compile NDK normally on Linux. It is also worth considering that the NDK richness of functionality also varies from version to version, it also depends on the specific device (manufacturers love to get into the kernel and standard libs and change them). Without JAV'y it will not work at all, at least it will be minimal. With the GUI, too, everything is sad, you need java or NativeActivity which, again, is a pipe through JNI.
In general, there is catastrophically little literature on the NDK, there are a lot of surprises, without java code, at most, you can do something on the console, which is even convenient in some ways.
I took a quick look now, it seems that there are frameworks with native UI for the NDK, for example, juce.com.

S
sitev_ru, 2016-07-02
@sitev_ru

Now I'll fill you with quotes from the Internet))

The C++ language maintains a high level of compatibility across platforms and devices.
You can port existing C++ libraries for Android and Windows platforms...

... well, etc ...

H
HolyBlackCat, 2016-07-13
@HolyBlackCat

If you take a good cross-platform framework, then you don’t have to write in Java.
For example, SDL comes with a project template for Android NDK with a ready-made Java wrapper that performs some initialization and calls native main ().
Connecting some other libraries requires dancing with a tambourine, but in the end, the code from desktop platforms works almost unchanged. Even OpenGL ES from native code works.
The manual for the selected framework and Google should be enough.
An increase in performance, but this is understandable.
The size of the binaries is larger: The code and all native libraries are compiled separately for different architectures (in my case there were 4) and assembled into one application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question