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
Need to update SDL2/android-project configs
GameCodingNinja


Joined: 29 Aug 2014
Posts: 32
The SDL2/android-project is the template for the build script SDL2/build-scripts/androidbuild.sh. The problem is the configs reference the SDK API level of 12 and there is no 12 so the build fails. There may have been an SDK 12 at on time but not anymore. The SDK API levels goes from 10 to 15. Replacing the 12 with 23 will solve the problem. Since the minimum version is 10, 23 just specifies the range. 15 could also be used since there's no 12 to reference.

SDL2/android-project/AndroidManifest.xml - line 12, replace 12 with 23.
SDL2/android-project/default.properties and project.properties - replace "target=android-12" with "target=android-23"

Now when someone new to android development reads the SDL2/docs/README-android.md and tries...
./androidbuild.sh org.libsdl.testgles ../test/testgles.c

the build won't fail leaving them confused.
Need to update SDL2/android-project configs
John
Guest

The reason 23 works on your machine is because you installed it. If you install
10 and 12, those will be available as well. Run $SDK/tools/android and select
the APIs you want to install. By default, only the latest API is installed,
which happens to be 23 in your setup.

On 03/27/2016 11:10 AM, GameCodingNinja wrote:
Quote:
The SDL2/android-project is the template for the build script
SDL2/build-scripts/androidbuild.sh. The problem is the configs reference the SDK
API level of 12 and there is no 12 so the build fails. There may have been an
SDK 12 at on time but not anymore. The SDK API levels goes from 10 to 15.
Replacing the 12 with 23 will solve the problem. Since the minimum version is
10, 23 just specifies the range. 15 could also be used since there's no 12 to
reference.

SDL2/android-project/AndroidManifest.xml - line 12, replace 12 with 23.
SDL2/android-project/default.properties and project.properties - replace
"target=android-12" with "target=android-23"

Now when someone new to android development reads the
SDL2/docs/README-android.md and tries...
./androidbuild.sh org.libsdl.testgles ../test/testgles.c

the build won't fail leaving them confused.


_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

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


Joined: 29 Aug 2014
Posts: 32
I install all of them but not the obsolete ones. If you install the Android SDK for the first time and download all the packages from the SDK Manager via the default settings, 12 wont be there. The next APK after 10 is 15. 12 could also be changed to 15. What I'm suggesting is that the provided example in SDL2/docs/README-android.md should work with the current SDK default settings. The readme doesn't specify that the obsolete API 12 is required.

One other suggestion I would like to add is that the below is needed in SDL2/android-project/jni/Application.mk to allow for debugging. First time android developers will need to step through their code to figure out why their game/engine is crashing out before it starts.

# Needed for debugging
APP_PLATFORM := android-10
M2tM


Joined: 28 Mar 2016
Posts: 5
While keeping project configs up to date is really good, I think with Visual Studio 2015 it would be *Fantastic* to ship a working Visual Studio 2015 solution with multiple targets set up for Windows, Windows Phone, Android, and iOS.

https://msdn.microsoft.com/en-IN/library/dn771552.aspx

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

Is anyone capable of doing this? I tried and am just not really familiar enough with SDL to do it myself without really sinking in and investing some serious time in build pipeline setup. Someone with more SDL and cross-platform experience stepping in to provide a public template would be *fantastic*. I'm even willing to paypal a $50 bounty for a working solution with an OpenGL context where you can run the Android emulator by hitting the play button in VS2015, or swap targets and execute on Windows.
Need to update SDL2/android-project configs
Eric Wing
Guest

First, I'll reiterate that I also recommend my Android/CMake build
proposal for SDL. I've written on this mailing list a few times about
it. It is particularly good if you want pre-built SDL libraries that
you want to link to in your project. There is also a few things in
place to make the SDK versions a little more automatic so you don't
hit the problem you were talking about.
https://bitbucket.org/ewing/sdl_androidcmake



Quote:

Is anyone capable of doing this? I tried and am just not really familiar
enough with SDL to do it myself without really sinking in and investing some
serious time in build pipeline setup. Someone with more SDL and
cross-platform experience stepping in to provide a public template would be
*fantastic*. I'm even willing to paypal a $50 bounty for a working solution
with an OpenGL context where you can run the Android emulator by hitting the
play button in VS2015, or swap targets and execute on Windows.



This is not exactly how you specified it, however the essence of an
easy to get going and use SDL in multiple environments (natively) is
something I've done.

Here's two quick videos showing SteamOS/Linux, OS X, iOS, Raspberry
Pi, and Android.

Workflow:
https://youtu.be/w8ftI9mpGdY

The Android Addendum
https://youtu.be/w6FY_qSi8yY


These were showing off Swift, but I support C, Lua, and JavaScript
too. (Visual Studio is supported.

Here is a more proper introduction
Part 1
https://youtu.be/wCWFqHJC_gI
Part 2:
https://youtu.be/MqROVNTfcmo
Part 3:
https://youtu.be/exPtM-02YRY


The major idea is that I pre-built a set of libraries (SDL and others)
for each platform. I have a unified build system for your project,
which will work across multiple platforms. On each platform you
generate the appropriate project and you use the system's native tools
(e.g. Xcode, Visual Studio, Android Studio). This saves you the
trouble of wrangling all the different build systems for every single
library for every platform and just lets you focus on your own app.
And you use the native toolchain for each platform so you are a
first-class citizen for each platform.

https://blurrrsdk.com

Thanks,
Eric
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Need to update SDL2/android-project configs
M2tM


Joined: 28 Mar 2016
Posts: 5
Eric Wing wrote:
First, I'll reiterate that I also recommend my Android/CMake build
proposal for SDL. I've written on this mailing list a few times about
it. It is particularly good if you want pre-built SDL libraries that
you want to link to in your project. There is also a few things in
place to make the SDK versions a little more automatic so you don't
hit the problem you were talking about.
https://bitbucket.org/ewing/sdl_androidcmake



Quote:

Is anyone capable of doing this? I tried and am just not really familiar
enough with SDL to do it myself without really sinking in and investing some
serious time in build pipeline setup. Someone with more SDL and
cross-platform experience stepping in to provide a public template would be
*fantastic*. I'm even willing to paypal a $50 bounty for a working solution
with an OpenGL context where you can run the Android emulator by hitting the
play button in VS2015, or swap targets and execute on Windows.



This is not exactly how you specified it, however the essence of an
easy to get going and use SDL in multiple environments (natively) is
something I've done.

Here's two quick videos showing SteamOS/Linux, OS X, iOS, Raspberry
Pi, and Android.

Workflow:
https://youtu.be/w8ftI9mpGdY

The Android Addendum
https://youtu.be/w6FY_qSi8yY


These were showing off Swift, but I support C, Lua, and JavaScript
too. (Visual Studio is supported.

Here is a more proper introduction
Part 1
https://youtu.be/wCWFqHJC_gI
Part 2:
https://youtu.be/MqROVNTfcmo
Part 3:
https://youtu.be/exPtM-02YRY


The major idea is that I pre-built a set of libraries (SDL and others)
for each platform. I have a unified build system for your project,
which will work across multiple platforms. On each platform you
generate the appropriate project and you use the system's native tools
(e.g. Xcode, Visual Studio, Android Studio). This saves you the
trouble of wrangling all the different build systems for every single
library for every platform and just lets you focus on your own app.
And you use the native toolchain for each platform so you are a
first-class citizen for each platform.

https://blurrrsdk.com

Thanks,
Eric
_______________________________________________
SDL mailing list

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


I've already invested quite a bit of time in my own code base, which is basically running with SDL + OpenGL, SDL_TTF, SDL_Image, SDL_Mixer, Boost, Chaiscript (header only), Cereal (header only). I'm not really super excited about adopting someone's SDK directly just to facilitate a build system.

All I really want is an example with Visual Studio set up making use of their new Android emulator support and iOS build support so I don't have to run cmake or something and can keep everything in one IDE. I suspect given a properly set up project I'd strip out any example code and just dump my own code into the solution.

Since VS2015 natively supports cross-platform development I'm interested in leveraging that if I can instead of subverting it and forcing multiple environments even if it's all from a single configured format (ant/cmake/blurrr).
Need to update SDL2/android-project configs
Alex Szpakowski
Guest

Visual Studio doesn’t support building for iOS devices. It has (had?) a buggy half-finished reimplementation of Apple’s iOS APIs running on x86, but that’s not the same thing.
Quote:
On Mar 28, 2016, at 8:39 PM, M2tM wrote:
I've already invested quite a bit of time in my own code base, which is basically running with SDL + OpenGL, SDL_TTF, SDL_Image, SDL_Mixer, Boost, Chaiscript (header only), Cereal (header only). I'm not really super excited about adopting someone's SDK directly just to facilitate a build system.All I really want is an example with Visual Studio set up making use of their new Android emulator support and iOS build support so I don't have to run cmake or something and can keep everything in one IDE. I suspect given a properly set up project I'd strip out any example code and just dump my own code into the solution.Since VS2015 natively supports cross-platform development I'm interested in leveraging that if I can instead of subverting it and forcing multiple environments even if it's all from a single configured format (ant/cmake/blurrr).
_______________________________________________SDL mailinghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Need to update SDL2/android-project configs
M2tM


Joined: 28 Mar 2016
Posts: 5
Alex Szpakowski wrote:
Visual Studio doesn’t support building for iOS devices. It has (had?) a buggy half-finished reimplementation of Apple’s iOS APIs running on x86, but that’s not the same thing.
Quote:
On Mar 28, 2016, at 8:39 PM, M2tM wrote:
I've already invested quite a bit of time in my own code base, which is basically running with SDL + OpenGL, SDL_TTF, SDL_Image, SDL_Mixer, Boost, Chaiscript (header only), Cereal (header only). I'm not really super excited about adopting someone's SDK directly just to facilitate a build system.All I really want is an example with Visual Studio set up making use of their new Android emulator support and iOS build support so I don't have to run cmake or something and can keep everything in one IDE. I suspect given a properly set up project I'd strip out any example code and just dump my own code into the solution.Since VS2015 natively supports cross-platform development I'm interested in leveraging that if I can instead of subverting it and forcing multiple environments even if it's all from a single configured format (ant/cmake/blurrr).
_______________________________________________SDL mailinghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


They do support hosting a solution in Windows that can target Xcode and build for you on iOS with a Mac though.

https://blogs.msdn.microsoft.com/vcblog/2015/06/04/developing-cross-platform-ios-applications-using-visual-studio/
mr_tawan


Joined: 13 Jan 2014
Posts: 161
Currently SDL2 (and SDL2_* lib) in Visual Studio use prebuilt version of its dependencies. To use the similar build in other platform than Win32, the prebuilt library of the target platform would be required. I think you can add those library into your solution, remove the prebuilt from the project's dependencies, and start building them around the same time. That should generate a proper so file for Android and whatever.

Anyway I personally prefer a proper CMake build (that could generate VS solution in a flash) than just a plain VS. I do cross platform development, so having a 'prebuild' system that generate files for multiple build systems is a big plus to me.
M2tM


Joined: 28 Mar 2016
Posts: 5
Yeah, I can see the value in CMake, I just would prefer a flatter toolchain and there's nothing much flatter than a single solution with a one-step build pipeline.