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


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 with android and the new anrdoid studio
Owen Alanzo Hogarth
Guest

Is anyone on this list currently building android apps from SDL2 with the new android studio? There seems to have been some changes to the way android is built with studio vs eclipse. If anyone has any experience w/ this new setup mind pinging back?
SDL2 with android and the new anrdoid studio
Michael Labbé
Guest

When I last checked in six months ago, gradle and android studio were not up to the task of working on mostly native android projects.

I have had the highest productivity working with the NVidia Tegra tools, an NVidia Shield and Visual Studio 2013 or 2012 (doesn't matter which).

I then deploy my sdk project for more architectures using ndk-build and ant.

Michael Labbé

Quote:
On Aug 20, 2015, at 12:40 PM, Owen Alanzo Hogarth wrote:

Is anyone on this list currently building android apps from SDL2 with the new android studio? There seems to have been some changes to the way android is built with studio vs eclipse. If anyone has any experience w/ this new setup mind pinging back?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 with android and the new anrdoid studio
Owen Alanzo Hogarth
Guest

I didn't even think about NVidia Tegra tools, I don't have a pc so the visual studio workflow is a non starter for me. I will look into the NVidia tools and see if I can get that to work. Thanks for the tip.

On Fri, Aug 21, 2015 at 3:56 AM, Michael Labbé wrote:
Quote:
When I last checked in six months ago, gradle and android studio were not up to the task of working on mostly native android projects.

I have had the highest productivity working with the NVidia Tegra tools, an NVidia Shield and Visual Studio 2013 or 2012 (doesn't matter which).

I then deploy my sdk project for more architectures using ndk-build and ant.

Michael Labbé

Quote:
On Aug 20, 2015, at 12:40 PM, Owen Alanzo Hogarth wrote:

Is anyone on this list currently building android apps from SDL2 with the new android studio? There seems to have been some changes to the way android is built with studio vs eclipse. If anyone has any experience w/ this new setup mind pinging back?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 with android and the new anrdoid studio
gormlai


Joined: 16 Jul 2012
Posts: 34
Location: United Kingdom
I contacted one Google's developer relations people, and unfortunately Android Studio still doesn't support subprojects which build libraries. I personally thought it better to wait, than to fudge it.

On 20/08/2015 21:23, Owen Alanzo Hogarth wrote:

Quote:
I didn't even think about NVidia Tegra tools, I don't have a pc so the visual studio workflow is a non starter for me. I will look into the NVidia tools and see if I can get that to work. Thanks for the tip.

On Fri, Aug 21, 2015 at 3:56 AM, Michael Labbé wrote:
Quote:
When I last checked in six months ago, gradle and android studio were not up to the task of working on mostly native android projects.

I have had the highest productivity working with the NVidia Tegra tools, an NVidia Shield and Visual Studio 2013 or 2012 (doesn't matter which).

I then deploy my sdk project for more architectures using ndk-build and ant.

Michael Labbé

Quote:
On Aug 20, 2015, at 12:40 PM, Owen Alanzo Hogarth wrote:

Is anyone on this list currently building android apps from SDL2 with the new android studio? There seems to have been some changes to the way android is built with studio vs eclipse. If anyone has any experience w/ this new setup mind pinging back?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Best,
Gorm Lai
Founder of Kotori Studios Ltd
@kotoristudios, @gormlai

SDL2 with android and the new anrdoid studio
Eric Wing
Guest

On 8/20/15, Owen Alanzo Hogarth wrote:
Quote:
Is anyone on this list currently building android apps from SDL2 with the
new android studio? There seems to have been some changes to the way
android is built with studio vs eclipse. If anyone has any experience w/
this new setup mind pinging back?


Yes, kind of...
I build SDL into library conforming to the Android NDK_MODULE
convention. (I've posted about this before on the list.)

At this point, it doesn't really matter what you use for the final
mile for your app, though I moved to Android Studio because it was
clear Google was dropping Eclipse/Ant and installing Ant dependencies
started becoming an ordeal for me on latest Mac. At the time, it had
no NDK support, so I hacked up my own Groovy/Gradle scripts to the
right thing for the NDK half of the build. I'm actually using CMake
for everything which makes it easy to support a ton of platforms with
a single build description, so my scripts call out to CMake coordinate
between the NDK/SDK halves. Then Android Studio does the rest of its
normal stuff for the SDK, signing, and packaging.

-Eric
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 with android and the new anrdoid studio
Martin Gerhardy
Guest

sorry for offtopic: do you use an android toolchain or do you use ndkbuild and use cmake just to generate the Andeoid.mk files? do you habe a link? my current cmake solution can be found in the link in my signature



http://www.caveproductions.org


Quote:
Am 21.08.2015 um 03:19 schrieb Eric Wing:

Quote:
On 8/20/15, Owen Alanzo Hogarth wrote:
Is anyone on this list currently building android apps from SDL2 with the
new android studio? There seems to have been some changes to the way
android is built with studio vs eclipse. If anyone has any experience w/
this new setup mind pinging back?

Yes, kind of...
I build SDL into library conforming to the Android NDK_MODULE
convention. (I've posted about this before on the list.)

At this point, it doesn't really matter what you use for the final
mile for your app, though I moved to Android Studio because it was
clear Google was dropping Eclipse/Ant and installing Ant dependencies
started becoming an ordeal for me on latest Mac. At the time, it had
no NDK support, so I hacked up my own Groovy/Gradle scripts to the
right thing for the NDK half of the build. I'm actually using CMake
for everything which makes it easy to support a ton of platforms with
a single build description, so my scripts call out to CMake coordinate
between the NDK/SDK halves. Then Android Studio does the rest of its
normal stuff for the SDK, signing, and packaging.

-Eric
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 with android and the new anrdoid studio
Owen Alanzo Hogarth
Guest

@Eric

I currently build SDL with cmake as well, I haven't really used much of android studio since I mostly do command line builds and what not. Is it fairly straight forward to have gradle work nicely with cmake?


On Fri, Aug 21, 2015 at 9:19 AM, Eric Wing wrote:
Quote:
On 8/20/15, Owen Alanzo Hogarth wrote:
Quote:
Is anyone on this list currently building android apps from SDL2 with the
new android studio? There seems to have been some changes to the way
android is built with studio vs eclipse. If anyone has any experience w/
this new setup mind pinging back?




Yes, kind of...
I build SDL into library conforming to the Android NDK_MODULE
convention. (I've posted about this before on the list.)

At this point, it doesn't really matter what you use for the final
mile for your app, though I moved to Android Studio because it was
clear Google was dropping Eclipse/Ant and installing Ant dependencies
started becoming an ordeal for me on latest Mac. At the time, it had
no NDK support, so I hacked up my own Groovy/Gradle scripts  to the
right thing for the NDK half of the build. I'm actually using CMake
for everything which makes it easy to support a ton of platforms with
a single build description, so my scripts call out to CMake coordinate
between the NDK/SDK halves. Then Android Studio does the rest of its
normal stuff for the SDK, signing, and packaging.

-Eric
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SparkyNZ


Joined: 02 Nov 2010
Posts: 72
I just hope somebody posts a blog/tutorial soon describing how to setup SDL with Android Studio. Thankfully I'm not starting my Android port yet..
scanner_darkly


Joined: 23 Aug 2015
Posts: 16
SparkyNZ wrote:
I just hope somebody posts a blog/tutorial soon describing how to setup SDL with Android Studio. Thankfully I'm not starting my Android port yet..


I used the same setup that you would for Eclipse for the most part. I'm using the latest Android Studio (1.3.2) with NDK r10e. Here's my app.grade:

Code:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 18
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "package.org"
        minSdkVersion 18
        targetSdkVersion 18

        ndk {
            moduleName 'main'
        }

    }

    sourceSets.main {
        jni.srcDirs = []
        jniLibs.srcDir 'src/main/libs'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}


And I had to add a "gradle.properties" file in the same directory as "build.gradle" file that had:

Code:
android.useDeprecatedNdk=true


And make sure to add this to Application.mk:

Code:
APP_PLATFORM := android-18


And then I run "ndk-build" from the Android Studio terminal from the JNI directory.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
scanner_darkly wrote:
..and then I run "ndk-build" from the Android Studio terminal from the JNI directory.


Thanks scanner! I have Eclipse/NDK set up on a Mac and I'd like to set Android Studio up on Windows.. That means I'll probably have to set up Eclipse etc first on my Win machine then try what you have posted. Thanks a lot though - I hope you don't mind further questions.
scanner_darkly


Joined: 23 Aug 2015
Posts: 16
No problem. I used this YouTube video as a reference: https://www.youtube.com/watch?v=5_we0KZqDlU (although it uses Eclipse)
And I used this StackOverflow post for help with AS ndk: http://stackoverflow.com/questions/16667903/android-studio-gradle-and-ndk
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
scanner_darkly wrote:
No problem. I used this YouTube video as a reference: https://www.youtube.com/watch?v=5_we0KZqDlU (although it uses Eclipse)
And I used this StackOverflow post for help with AS ndk: http://stackoverflow.com/questions/16667903/android-studio-gradle-and-ndk


Hi Scanner. Would you like to upload/make publicly available a simple SDL "Hello World" project for Android Studio please?
scanner_darkly


Joined: 23 Aug 2015
Posts: 16
Quote:
Hi Scanner. Would you like to upload/make publicly available a simple SDL "Hello World" project for Android Studio please?


I created a sample project that uses SDL2, GLM, and OpenGL ES 3 (although you can comment out the GLM and OpenGL stuff if desired). Let me know if you have any questions, I added details in the README of the project.

Link: https://gitlab.com/scannerdarkly/hello-sdl-android
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
Thanks Scanner. I am using Windows (guess you're using Mac/Linux?) and I'm having some problems with ndk-build.

W:\hello-sdl-android\android-project\app\src\main\jni>ndk-build
make.exe: *** No rule to make target `W:/hello-sdl-android/android-project/app/s
rc/main/jni/src/../SDL2/src/main/android/SDL_android_main.c', needed by `W:/hell
o-sdl-android/android-project/app/src/main/obj/local/armeabi/objs/main/__/SDL2/s
rc/main/android/SDL_android_main.o'. Stop.

I suspect that the SDL2 paths above are wrong. My SDL2 content is in folder W:\SDL2. I modified the SDL2 and GLM link variables to point to these locations (and also declared some environment variables) but its still not happy.

Other than Android.mk and Application.mk, is there another .mk file which I will need to modify.. or will I have to change another type of file? Gradle and Android Studio are new to me so I'm a little lost.

Thanks.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
I found that I needed to change the SDL_PATH and GLM_PATH in the jni\src\Android.mk to get it to start compiling.

Now I have the following (linker?) problem:

Code:
W:\hello-sdl-android\android-project\app\src\main\jni>ndk-build
[armeabi] Compile thumb  : main <= SDL_android_main.c
[armeabi] Compile++ thumb: main <= Main.cpp
[armeabi] SharedLibrary  : libmain.so
W:\SDL2\SDL2-2.0.3/src/main/android/SDL_android_main.c:23: error: undefined reference to 'SDL_Android_Init'


The Android.mk only seems to include one SDL source file:

Code:
# Add your application source files here...
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
   Main.cpp


Is SDL_android_main.c supposed to include SDL_android.c somehow? This is where SDL_Android_Init() is defined.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
Actually.. I am wondering if putting SDL and GLM into folders on my W:\ is what is causing my problem?

Since you have used 'ln' to link the SDL and GLM folders under your test project.. then your SDL and GLM folders would "appear" to be sub-folders of your project folder wouldn't they?

Since there is no 'ln' command in Windows, perhaps I need to make local copies of the SDL and GLM source under the test app project folder?
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
I made copies of SDL2 and GLM content in the folders where you had the ln links. ndk-build works fine now - I can build the application via command-line.

My only questions now are:
1) Can Android Studio build/call the ndk-build on my behalf? (ie can I build from within the IDE)
2) How do you run the application? My Samsung device installed but I cannot get a 'select device' dialog to appear. When I select "Run" I get a drop-box with "Edit Configurations" displayed. Do I *need* to create a new configuration or just use the "Defaults"? Under "Android Application" I have tried both "Show chooser dialog" and "Use USB device" but neither are doing anything when I click on "Run'.

I have used this device before for simple Hello World java test apps - but only with Eclipse on a different laptop.

Would you recommend I try getting a simple Java test app to work before trying to get an NDK app working?
scanner_darkly


Joined: 23 Aug 2015
Posts: 16
Hey, glad to see you have parts of it working now. I think my example might have been a bit overkill using OpenGL and GLM but it looks like you got that working too.

In regards to the questions...

SparkyNZ wrote:

1) Can Android Studio build/call the ndk-build on my behalf? (ie can I build from within the IDE)


I think so but I prefer to execute it manually. According to this Stack Overflow post you can have Gradle take care of the NDK http://stackoverflow.com/questions/16667903/android-studio-gradle-and-ndk

SparkyNZ wrote:

2) How do you run the application? My Samsung device installed but I cannot get a 'select device' dialog to appear. When I select "Run" I get a drop-box with "Edit Configurations" displayed. Do I *need* to create a new configuration or just use the "Defaults"? Under "Android Application" I have tried both "Show chooser dialog" and "Use USB device" but neither are doing anything when I click on "Run'.


You shouldn't have to modify any of these modifications at all. You do need to setup a USB driver (usually) for your device and your Operating System to connect, and then Android Studio should take care of the rest. Try going to "Build -> Make Project" in Android Studio. Also right below that where the little Android icon is there should be a drop-down menu, switch it from "Edit Configurations" to "App". If there is no app option then there's a problem!

SparkyNZ wrote:


I have used this device before for simple Hello World java test apps - but only with Eclipse on a different laptop.

Would you recommend I try getting a simple Java test app to work before trying to get an NDK app working?


Definitely. Create a new "Hello World" Android Studio Java project and make sure that you can run that on your device first before using the SDL project. Let me know how things go!
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
scanner_darkly wrote:
Hey, glad to see you have parts of it working now. I think my example might have been a bit overkill using OpenGL and GLM but it looks like you got that working too.


Thanks again - definitely making progress here. I just repeated the same process on my other PC. I definitely have a driver issue to sort out on my other laptop. On this PC it runs.. and crashes.. I had to lower the SDK versions from 18 to 15 (API 17 may have been OK - my devices has Android 4.2.2) but I noticed in the logcat an error stating that "libGLESv3.so" could not be found. (See below).

Thanks for the Gradle/NDK link - I'll be sure to check that out once I get this demo app to work.

Do have any idea what could be causing the libGLESv3.so issue? Does the project need to be tweaked to use GLESv2 or something?

Code:
11-04 14:14:13.170  19641-19641/? D/dalvikvm﹕ Trying to load lib /data/app-lib/org.libsdl.app-1/libSDL2.so 0x41c45188
11-04 14:14:13.170  19641-19641/? D/dalvikvm﹕ Added shared lib /data/app-lib/org.libsdl.app-1/libSDL2.so 0x41c45188
11-04 14:14:13.170  19641-19641/? D/dalvikvm﹕ Trying to load lib /data/app-lib/org.libsdl.app-1/libmain.so 0x41c45188
11-04 14:14:13.170  19641-19641/? E/dalvikvm﹕ dlopen("/data/app-lib/org.libsdl.app-1/libmain.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libGLESv3.so" needed by "libmain.so"; caused by load_library(linker.cpp:746): library "libGLESv3.so" not found
11-04 14:14:13.170    2485-2485/? D/STATUSBAR-QuickSettingPanel﹕ update() : DB_NUMBER_OF_APPS = 10
11-04 14:14:13.175  19641-19641/? W/dalvikvm﹕ Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/libsdl/app/SDLActivity;
11-04 14:14:13.175  19641-19641/? W/dalvikvm﹕ Class init failed in newInstance call (Lorg/libsdl/app/SDLActivity;)
11-04 14:14:13.175  19641-19641/? D/AndroidRuntime﹕ Shutting down VM
11-04 14:14:13.175  19641-19641/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41731930)
11-04 14:14:13.175    2485-2485/? D/STATUSBAR-QuickSettingPanel﹕ update() : DB_NUMBER_OF_APPS = 10
11-04 14:14:13.175    2485-2485/? D/STATUSBAR-QuickSettingPanel﹕ update() : DB_NUMBER_OF_APPS = 10
11-04 14:14:13.175  19641-19641/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.ExceptionInInitializerError
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1319)
            at android.app.Instrumentation.newActivity(Instrumentation.java:1071)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2295)
            at android.app.ActivityThread.access$700(ActivityThread.java:150)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5279)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libGLESv3.so" needed by "libmain.so"; caused by load_library(linker.cpp:746): library "libGLESv3.so" not found
            at java.lang.Runtime.loadLibrary(Runtime.java:371)
            at java.lang.System.loadLibrary(System.java:535)
            at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:54)
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1319)
            at android.app.Instrumentation.newActivity(Instrumentation.java:1071)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2295)
            at android.app.ActivityThread.access$700(ActivityThread.java:150)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5279)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            at dalvik.system.NativeStart.main(Native Method)
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
scanner_darkly wrote:
Hey, glad to see you have parts of it working now. I think my example might have been a bit overkill using OpenGL and GLM but it looks like you got that working too.


Just a quick update - I tried my Samsung S4 instead of my Samsung 8" tablet - it works fine on the S4!

So the question is - is this an SDL2 issue, a configuration issue or an application/build issue?
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
http://delphigl.de/glcapsviewer/gles_generatereport.php?reportID=384

Ok. My tablet api is 17. If I try to build your project with 17 instead of 18, it cannot include the GLES3 header files.

I do want to do basic GLSL .. nothing special. So by the looks of things I will have to drop to GLES2?

The below link claims my tablet supports GLES3.. but thats way over my head. Above link I mean. Hard to type on tablets.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
OpenGL ES2 appears to work on my device with API 17.

Only one (last?) problem to resolve - SDL related:

Code:
11-04 18:44:18.165  27550-27576/org.libsdl.app E/SDL/ERROR﹕ The specified window has not been made current


I commented out the VAO (OpenGL ES3) lines in your sample app. The app runs but gives me a black screen and nothing else.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
Thanks heaps for this, Scanner! I may have to upload a copy of my derived project. I have managed to get it to work with OpenGL ES2 on both my Samsung devices with API 17. I replaced the code so that it just draws a red triangle but thats more than enough to get me started. I can finally move my SDL1.x app from Windows over to Android and iOS.
scanner_darkly


Joined: 23 Aug 2015
Posts: 16
SparkyNZ wrote:
Thanks heaps for this, Scanner! I may have to upload a copy of my derived project. I have managed to get it to work with OpenGL ES2 on both my Samsung devices with API 17. I replaced the code so that it just draws a red triangle but thats more than enough to get me started. I can finally move my SDL1.x app from Windows over to Android and iOS.


Awesome! Yeah, GLES 3 requires API 18, but is fully compatible with GLES 2.
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
If it will help anybody, here's a link to an Android Studio SDL2 project that will build under Android Studio itself (you don't need to run ndk-build from the command line). It does include the SDL2 source itself - I had some trouble getting the 'exclude' command to work at first so I have deleted all of the non-Android folders in the archive. I need to investigate more on whether or not static libraries will work with the experimental gradle plugin - surely they must..

This is a mutates version of Scanner's project - it just draws a red triangle, uses GLES2 and it runs on both of my Samsung devices.

Hope it helps - as of today, Android Studio still isn't ready to support NDK and SDL2 in my opinion. Hopefully it will be complete soon.

http://www.mediafire.com/download/3i2175onr9gchb7/hello-sdl-android_RUNS.zip

I've tested this on Win8 & 7 - haven't tried it on my Mac yet.. hopefully it will work without too many changes.
ace491


Joined: 07 Jun 2014
Posts: 24
Has there been any advancement in this? Is Android Studio any more ready to support NDK and SDL2? Getting my SDL2 programs to run on android using Eclipse seemed excessively convoluted, but perhaps that's how all native is on android. Does Android Studio seem any simpler?
SparkyNZ


Joined: 02 Nov 2010
Posts: 72
ace491 wrote:
Has there been any advancement in this? Is Android Studio any more ready to support NDK and SDL2? Getting my SDL2 programs to run on android using Eclipse seemed excessively convoluted, but perhaps that's how all native is on android. Does Android Studio seem any simpler?


I haven't heard anything and I keep nosing around the Android Developer and Gradle forum. Seems to be taking quite a while. AS looked better to me - Eclipse takes forever to load - but I have just left my Android development until last given the current situation. I'm working on a new cross-plaform app so I would like to use it, but its just not ready and there's little support if you get stuck. Microsoft's VS2015 is worth a look with its Android support though.
SDL2 with android and the new anrdoid studio
M2tM


Joined: 28 Mar 2016
Posts: 5
Yeah I had a stackoverflow question about vs2015 setup, used to have a 500 point bounty but it expired:



http://stackoverflow.com/questions/36147257/how-do-i-set-up-visual-studio-2015-with-sdl2-for-android-ios-and-windows-devel




Sent from my iPhone
On Apr 7, 2016, at 9:46 PM, SparkyNZ wrote:


Quote:







ace491 wrote: Has there been any advancement in this? Is Android Studio any more ready to support NDK and SDL2? Getting my SDL2 programs to run on android using Eclipse seemed excessively convoluted, but perhaps that's how all native is on android. Does Android Studio seem any simpler?


I haven't heard anything and I keep nosing around the Android Developer and Gradle forum. Seems to be taking quite a while. AS looked better to me - Eclipse takes forever to load - but I have just left my Android development until last given the current situation. I'm working on a new cross-plaform app so I would like to use it, but its just not ready and there's little support if you get stuck. Microsoft's VS2015 is worth a look with its Android support though.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hawkeye


Joined: 08 Sep 2016
Posts: 1
Hi,

Found this thread in Google when searching for ways to get SDL working with the new Gradle build system for Android. I managed to get SDL and a simple example program compiling using gradle-experimental (which supports the NDK):

https://github.com/stephen47/android-sdl2-gradle-template

I've not tried it with Android Studio (just using the gradle wrapper command line) but I think it should work (my code is based off one of the Google NDK example projects). I'm just finding my way around Gradle so there might be better ways to do it (one of the things I want it to do it build the "main" library when assembleDebug is invoked). Hopefully you find it useful and would love to get some feedback if you find improvements Smile

Stephen