Status of SDL for Android?

With the Ouya coming out in just a few months, what’s the status of SDL for Android?

Mason

Well, I’ve been using it for some basic graphics + input stuff, so it does
work. Haven’t ported any games or similar “full” applications yet, though.On Wednesday 24 October 2012, at 19.47.20, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL for
Android?


//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://consulting.olofson.net http://olofsonarcade.com |
’---------------------------------------------------------------------’

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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

It seems like it still builds and works pretty well. I have an updated
android-project directory that I’m working on and will commit in a day or
two.

File I/O is a pain and I’ll be improving that soon.On Wed, Oct 24, 2012 at 11:31 AM, Sam Lantinga <@slouken> wrote:

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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

Okay, I updated the Android project directory, added most information to
README.android and added some new API functions to SDL_system.h:

SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()

These should allow people to extend SDLActivity with their own Java
functionality and use JNI to call into it, as well as give SDL applications
more information on the state of storage.

How many people would want an initial download stage built into the default
Android project?

Cheers!On Thu, Nov 1, 2012 at 8:49 PM, Sam Lantinga <@slouken> wrote:

It seems like it still builds and works pretty well. I have an updated
android-project directory that I’m working on and will commit in a day or
two.

File I/O is a pain and I’ll be improving that soon.

On Wed, Oct 24, 2012 at 11:31 AM, Sam Lantinga <@slouken> wrote:

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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

+1 from me.On Fri, Nov 2, 2012 at 11:51 AM, Sam Lantinga wrote:

Okay, I updated the Android project directory, added most information to
README.android and added some new API functions to SDL_system.h:

SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()

These should allow people to extend SDLActivity with their own Java
functionality and use JNI to call into it, as well as give SDL applications
more information on the state of storage.

How many people would want an initial download stage built into the default
Android project?

Cheers!

On Thu, Nov 1, 2012 at 8:49 PM, Sam Lantinga wrote:

It seems like it still builds and works pretty well. I have an updated
android-project directory that I’m working on and will commit in a day or
two.

File I/O is a pain and I’ll be improving that soon.

On Wed, Oct 24, 2012 at 11:31 AM, Sam Lantinga wrote:

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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


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

What do you mean by initial download stage?On 11/02/2012 05:51 AM, Sam Lantinga wrote:

Okay, I updated the Android project directory, added most information to
README.android and added some new API functions to SDL_system.h:

SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()

These should allow people to extend SDLActivity with their own Java
functionality and use JNI to call into it, as well as give SDL applications
more information on the state of storage.

How many people would want an initial download stage built into the default
Android project?

Cheers!

On Thu, Nov 1, 2012 at 8:49 PM, Sam Lantinga wrote:

It seems like it still builds and works pretty well. I have an updated
android-project directory that I’m working on and will commit in a day or
two.

File I/O is a pain and I’ll be improving that soon.

On Wed, Oct 24, 2012 at 11:31 AM, Sam Lantinga wrote:

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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


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

I verified that the SDL_RWops API works well for getting assets packed into
the APK and also for getting files in the internal and external storage
paths, so I’ll leave a download stage out for now. It’s one less failure
point for people who get your application and install it.

However, I completely understand that large applications will want to be
able to download additional assets to external storage. I’m certainly not
opposed to anyone submitting a patch for this functionality, as long as
it’s reasonably self-contained and is entirely optional.On Fri, Nov 2, 2012 at 2:51 AM, Sam Lantinga <@slouken> wrote:

Okay, I updated the Android project directory, added most information to
README.android and added some new API functions to SDL_system.h:

SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()

These should allow people to extend SDLActivity with their own Java
functionality and use JNI to call into it, as well as give SDL applications
more information on the state of storage.

How many people would want an initial download stage built into the
default Android project?

Cheers!

On Thu, Nov 1, 2012 at 8:49 PM, Sam Lantinga <@slouken> wrote:

It seems like it still builds and works pretty well. I have an updated
android-project directory that I’m working on and will commit in a day or
two.

File I/O is a pain and I’ll be improving that soon.

On Wed, Oct 24, 2012 at 11:31 AM, Sam Lantinga <@slouken>wrote:

A bunch of people have been using it and submitting patches for it
occasionally.

I’m probably going to port Maelstrom to it in the next month or two, and
I’ll be fixing anything I run into as well.

Take a crack at it and let me know how it goes!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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

I just fixed mouse and keyboard input, the filesystem code works well, and
OpenGL ES 1.1 and 2.0 are both completely functional.

I’ve added a bunch more documentation to README.android so it should be
easier to get started now.

See ya!On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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

Thanks for the work!

I’ll have a look at it later today.–
Paulo

On Mon, Nov 5, 2012 at 8:01 AM, Sam Lantinga wrote:

I just fixed mouse and keyboard input, the filesystem code works well, and
OpenGL ES 1.1 and 2.0 are both completely functional.

I’ve added a bunch more documentation to README.android so it should be
easier to get started now.

See ya!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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


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

Hi Sam,

just noticed that the README file still states that one should not modify
the AndroidManifest.xml file,
followed with a section that explains how to modify it. :)–
Paulo

On Mon, Nov 5, 2012 at 8:01 AM, Sam Lantinga wrote:

I just fixed mouse and keyboard input, the filesystem code works well, and
OpenGL ES 1.1 and 2.0 are both completely functional.

I’ve added a bunch more documentation to README.android so it should be
easier to get started now.

See ya!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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


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

2012/11/5 Sam Lantinga

I verified that the SDL_RWops API works well for getting assets packed
into the APK and also for getting files in the internal and external
storage paths, so I’ll leave a download stage out for now. It’s one less
failure point for people who get your application and install it.

However, I completely understand that large applications will want to be
able to download additional assets to external storage. I’m certainly not
opposed to anyone submitting a patch for this functionality, as long as
it’s reasonably self-contained and is entirely optional.

Did you try this using SDL_TTF? This used to be the killer combo for me, it
ended up hanging every time fairly quickly, and every time it hanged it was
while inside a JVM call (the workaround I’m now using is reading the font
in memory and loading from there, which works). That’s why we had on the
todo list modifying the RWops stuff and replacing it with something more
similar to what SCUMMVM uses.–
Gabriel.

Yup, SDL_ttf works great here. It hung up pretty hard at first, but I ran
valgrind and tracked it down to a 1 byte memory overwrite bug in my game
code! After I fixed that it was just peachy, but SDL_ttf exposed it
immediately by hanging in the seek.On Mon, Nov 5, 2012 at 4:45 AM, Gabriel Jacobo wrote:

2012/11/5 Sam Lantinga <@slouken>

I verified that the SDL_RWops API works well for getting assets packed
into the APK and also for getting files in the internal and external
storage paths, so I’ll leave a download stage out for now. It’s one less
failure point for people who get your application and install it.

However, I completely understand that large applications will want to be
able to download additional assets to external storage. I’m certainly not
opposed to anyone submitting a patch for this functionality, as long as
it’s reasonably self-contained and is entirely optional.

Did you try this using SDL_TTF? This used to be the killer combo for me,
it ended up hanging every time fairly quickly, and every time it hanged it
was while inside a JVM call (the workaround I’m now using is reading the
font in memory and loading from there, which works). That’s why we had on
the todo list modifying the RWops stuff and replacing it with something
more similar to what SCUMMVM uses.


Gabriel.


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

Hah, good catch, thanks. :)On Mon, Nov 5, 2012 at 2:02 AM, Paulo Pinto wrote:

Hi Sam,

just noticed that the README file still states that one should not modify
the AndroidManifest.xml file,
followed with a section that explains how to modify it. :slight_smile:


Paulo

On Mon, Nov 5, 2012 at 8:01 AM, Sam Lantinga <@slouken> wrote:

I just fixed mouse and keyboard input, the filesystem code works well,
and OpenGL ES 1.1 and 2.0 are both completely functional.

I’ve added a bunch more documentation to README.android so it should be
easier to get started now.

See ya!

On Wed, Oct 24, 2012 at 10:47 AM, Mason Wheeler wrote:

With the Ouya coming out in just a few months, what’s the status of SDL
for Android?

Mason


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


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


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

That’s good to know; I was nervous about the behaviour Gabriel had
been seeing. Having said that, the Scummvm way would be considerably
more simple, assuming it works.On Mon, 5 Nov 2012 07:37:56 -0800 Sam wrote:

Yup, SDL_ttf works great here. It hung up pretty hard at first, but
I ran valgrind and tracked it down to a 1 byte memory overwrite bug
in my game code! After I fixed that it was just peachy, but SDL_ttf
exposed it immediately by hanging in the seek.

What is the SCUMMVM way? If it’s just fopen() with the internal data path,
that’s now implemented in SDL as well. :slight_smile:

The trick is getting the data to the internal data path, since there’s no
automatic way to do that right now. It’s either pull it out of the asset
manager or download it. Downloading is not a bad way to do it, which is
why I originally asked if people wanted it in the base activity code.On Mon, Nov 5, 2012 at 2:21 PM, Tim Angus wrote:

On Mon, 5 Nov 2012 07:37:56 -0800 Sam wrote:

Yup, SDL_ttf works great here. It hung up pretty hard at first, but
I ran valgrind and tracked it down to a 1 byte memory overwrite bug
in my game code! After I fixed that it was just peachy, but SDL_ttf
exposed it immediately by hanging in the seek.

That’s good to know; I was nervous about the behaviour Gabriel had
been seeing. Having said that, the Scummvm way would be considerably
more simple, assuming it works.


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

From the original thread:

We use this since day one for ScummVM, and it works on a metric ton of
devices on API level 6:
https://github.com/scummvm/scummvm
/blob/master/backends/platform/android/asset-archive.cpp#L473
https://github.com/scummvm/scummvm
/blob/master/backends/platform/android/asset-archive.cpp#L239

2012/11/6 Sam Lantinga > What is the SCUMMVM way? If it’s just fopen() with the internal data

path, that’s now implemented in SDL as well. :slight_smile:

The trick is getting the data to the internal data path, since there’s no
automatic way to do that right now. It’s either pull it out of the asset
manager or download it. Downloading is not a bad way to do it, which is
why I originally asked if people wanted it in the base activity code.

On Mon, Nov 5, 2012 at 2:21 PM, Tim Angus wrote:

On Mon, 5 Nov 2012 07:37:56 -0800 Sam wrote:

Yup, SDL_ttf works great here. It hung up pretty hard at first, but
I ran valgrind and tracked it down to a 1 byte memory overwrite bug
in my game code! After I fixed that it was just peachy, but SDL_ttf
exposed it immediately by hanging in the seek.

That’s good to know; I was nervous about the behaviour Gabriel had
been seeing. Having said that, the Scummvm way would be considerably
more simple, assuming it works.


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


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


Gabriel.

Looks awesome. Does anyone want to take a crack at that method for SDL?
Note that we can’t just copy the code because it’s GPL, we have to write
our own.On Tue, Nov 6, 2012 at 3:20 AM, Gabriel Jacobo wrote:

From the original thread:

We use this since day one for ScummVM, and it works on a metric ton of
devices on API level 6:
https://github.com/scummvm/scummvm
/blob/master/backends/platform/android/asset-archive.cpp#L473
https://github.com/scummvm/scummvm
/blob/master/backends/platform/android/asset-archive.cpp#L239

2012/11/6 Sam Lantinga <@slouken>

What is the SCUMMVM way? If it’s just fopen() with the internal data
path, that’s now implemented in SDL as well. :slight_smile:

The trick is getting the data to the internal data path, since there’s no
automatic way to do that right now. It’s either pull it out of the asset
manager or download it. Downloading is not a bad way to do it, which is
why I originally asked if people wanted it in the base activity code.

On Mon, Nov 5, 2012 at 2:21 PM, Tim Angus wrote:

On Mon, 5 Nov 2012 07:37:56 -0800 Sam wrote:

Yup, SDL_ttf works great here. It hung up pretty hard at first, but
I ran valgrind and tracked it down to a 1 byte memory overwrite bug
in my game code! After I fixed that it was just peachy, but SDL_ttf
exposed it immediately by hanging in the seek.

That’s good to know; I was nervous about the behaviour Gabriel had
been seeing. Having said that, the Scummvm way would be considerably
more simple, assuming it works.


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


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


Gabriel.


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