haxx
haxx

Reputation: 31

Is SDK viable for 3D engine dev or should I go straight for NDK?

Like title states - I want to write a 3D OpenGL ES 2.0 engine for Android (not interested in making games, just engine). Should I go straight for NDK and write everything in C++ or go for Java first?

Most links about Android performance are from 2010, before JIT and concurrent garbage collector came about. Is performance of Java still so bad (don't use public fields, don't use virtual methods) and what kind of speedup should I expect using C++?

By the way, I am comfortable in both languages, so there's no comfort issues involved.

Upvotes: 3

Views: 183

Answers (1)

pictr
pictr

Reputation: 99

According to how Android is designed and how it works there is 1 single thread dedicated to Java/SDK and 1 dedicated to the NDK/C++ applications, both the SDK and the NDK can only generate applications that will run in a sandbox, infact is slightly incorrect to define applications created with the NDK as "native" because you can never go native with a commercial and official Android toolkit, both solutions lead to the use of the Android virtual machine.

As consequence they offer roughly the same trade-off for the developer, both solutions need permissions and both solutions are packed in an apk in the end, the main reason why many pick C++ over Java it's because you can quite easily port a C++ engine to other platforms, you can't do the same with Java.

I suggest to go with C++ if you want a cross-platform solution, use Java if you don't need a cross platform solution, Java will be much easier to handle because of the reachness of the APIs and less cumbersome pipeline, especially for the "building and compiling" part.

Upvotes: 2

Related Questions