Jump to content
  • Advertisement
Sign in to follow this  
Phil15

Visual studio Android Native Activity project VS NDK

This topic is 949 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

There is a small dilemma, After developing a basic 3d engine in c++ it now needs to be ported to Android.
 I was going to go with the usual NDK approach using JNI and calling the c++ library from Java. But now there is this Android native activity in Visual 

Studio 2015( which uses c++)  and I don`t know if there are any disadvantages to using it. Most people say it`s slower but they usually refer to c# when saying that, I dont see how it can be slower with c++, does anyone  have any idea on this subject ?

Share this post


Link to post
Share on other sites
Advertisement

I can't see why native would be slower either.

I'd go with the usual approach of having the bulk of your code as c++, but using JNI and Java. Primarily because that way it's easier to plug in stuff like Google Play Game Services and Ad Networks and Facebook, etc. Depending on the title you're developing, there can be a surprising number of annoying SDKs to integrate, and lots of them won't have pure native versions.

Share this post


Link to post
Share on other sites
The choice between a native activity or not isn't going to make a difference in performance.


What you do in your code, how you implement your game, the choices you make with the software, those details are what make the difference.

People can write bad code with any set of tools. Some tools make it a little easier to write good code, others tools less so.

Share this post


Link to post
Share on other sites

I also don't use native activity for similar reasons - integration with Android UI stuff if ever needed, but also because of dependency with the glue library, which I prefer not to use. Binding Java with native code is trivial.

Share this post


Link to post
Share on other sites

I can just agree with all previous posters.

 

Native activity is just a JNI layer written by google, you can just as well write it yourself, and performance will likely neither be better or worse, but you have the advantage of more control over your integration code.

Share this post


Link to post
Share on other sites

I would recommend taking the native activity route if you want to get up and running in a limited amount of time. However, if you are familiar with JNI and all its gory details then by all means use whatever you are more comfortable with. The native app glue is not much of a hassle as it was pointed out to be. Its just a single source file that you add to your project, and if your project uses other external dependencies, then adding it shouldn't be a problem or hassle. As for the UI argument that was pointed out, that is also a non-issue as using native activity does not preclude using Android UI classes. You can use them via another activity in your manifest or via JNI ( both cases works fine in my application ). In any case frob's post more succinctly sum everything up. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!