The SDL forums have moved to
This is just a read-only archive of the previous forums, to keep old links working.

SDL Forum Index
Simple Directmedia Layer Forums
Android Native Activity Support

Joined: 09 Jun 2015
Posts: 11
Hello guys, For the last month I have been doing my research on the best way to port my C++ project to android, and the most elegant way I found is using "Android Studio" with "Native Activity". Unfortunately, I see that this is not supported by SDL(I understand that before September this was experimental so I can understand why might had not been supported). So my Questions are: - Is it in the plans to support the "Native Activity" build? - If yes then when?(So should I wait a couple months, or move to something else.) Thanks before hand for you answers.
Android Native Activity Support

Well, if I understand things correctly, then "NativeActivity" is a simple "pre-compiled Java Activity" that native code might link against, if it wanted to avoid any Java coding. In that case, all Android lifecycle handling must be done in the native code as well (e.g. all the stuff that currently does would have to be ported, roughly speaking). Finally, there wouldn't be much of a difference from a technical view, you would still build & run an app.

I don't know how good debugging support for the native code is in Android Studio now, I was only using "ndk-gdb" from the command line.



---------- Původní zpráva ----------
Od: maartenengels
Datum: 26. 11. 2016 22:38:05
Předmět: Re: [SDL] Android Native Activity Support
Hello @GameCodingNinja,

I am currently doing it the crapy way that I found on the readme file, with no IDE and no debugging. But thats not ideal.

"Native Activity is not supported by SDL, and has nothing to do with gradle. It is C++ and CMake, all my libraries build and the project compiles but when you try to do SDL_Init you can't, because it gives you an error that its missing the SDL_main and from what I read I understand that I need SDL_Activity to do that. So that really doesn't feel efficient or ideal to me.

"Native Activity" is not based on an experimental gradle anymore it comes with Android Studio out of the box. Of course it has only been like that since September. So what I am wondering is if its is the plans to support the Native Activity way.

SDL mailing list

Joined: 09 Jun 2015
Posts: 11
Well you can include CMake list in your build, you can actually use Android studio to debug your application, you can handle files and other utilities directly from c++ without having to go to the java code.

I see a lot of + in this way.