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
SDL on Google Android
MBrening


Joined: 09 Nov 2009
Posts: 79
Location: Shawnee, Kansas
Hello everyone!

I know this is sort of a duplicate thread. I recently got a phone with Android on it and I want to start programming for it. Naturally I'd love to be able to use SDL for this since i'm already familiar with it and I know how to do what I want it to do.

After doing some searches I found several threads where it talked about getting SDL working on Android. But I never found any actual answers as to how to do it.

Is there any site that can tell from start to finish how to develop an SDL program for an Android phone? (what toolchain, libraries, etc)

Thanks in advance! And sorry for the duplicate thread!

- Micah
Re: SDL on Google Android
MBrening


Joined: 09 Nov 2009
Posts: 79
Location: Shawnee, Kansas
The only reason I ask is that I'm seeing thread after thread after thread regarding getting SDL working on the iPhone.
That's all well and good. But what about the Android? Can't it be shown a little love?


MBrening wrote:
Hello everyone!

I know this is sort of a duplicate thread. I recently got a phone with Android on it and I want to start programming for it. Naturally I'd love to be able to use SDL for this since i'm already familiar with it and I know how to do what I want it to do.

After doing some searches I found several threads where it talked about getting SDL working on Android. But I never found any actual answers as to how to do it.

Is there any site that can tell from start to finish how to develop an SDL program for an Android phone? (what toolchain, libraries, etc)

Thanks in advance! And sorry for the duplicate thread!

- Micah
nfries88


Joined: 24 Oct 2009
Posts: 100
you should be able to use NDK for SDL apps, whether you link statically or dynamically (correct me if I'm wrong).

There is an SDL 1.2 port of SDL for Android already, but no SDL 1.3 port.
MBrening


Joined: 09 Nov 2009
Posts: 79
Location: Shawnee, Kansas
I was able to find the SDL 1.2 port that was used to make alienblaster.
I attempted to mimic the project but remove all of the game specific code to make a minimalistic SDL example (just initialize the window, and draw a box)

A couple issues I've run across. The port requires android 1.6 or higher. the droid phones from Verizon are currently on 1.5 with rumors of a 2.0 upgrade in the works. But until then, it means I can't run any of the programs on my current phone.

The second issue is that I can't get alienblaster to work in the emulator because it requires downloading the image data and the emulator isn't connected to the internet. So it fails

When I made a minimalistic SDL program, it hangs and the only debugging information I can find is that the activity took too long to initialize.

Long story short... this is much more of a pain than I thought it would be. obviously it is very likely I'm overlooking something very simple, but I can't find any documentation as to how to get the sdl port to work with the NDK and the SDK.


nfries88 wrote:
you should be able to use NDK for SDL apps, whether you link statically or dynamically (correct me if I'm wrong).

There is an SDL 1.2 port of SDL for Android already, but no SDL 1.3 port.
nfries88


Joined: 24 Oct 2009
Posts: 100
MBrening wrote:
A couple issues I've run across. The port requires android 1.6 or higher. the droid phones from Verizon are currently on 1.5 with rumors of a 2.0 upgrade in the works. But until then, it means I can't run any of the programs on my current phone.

It does? Does it have a GLES backend, then? As far as I'm aware that's the only primary difference between 1.5 and 1.6 NDK.
Try just getting the headers and libs from the 1.6 NDK and using them with the 1.5 NDK. It might work fine.

Quote:
Long story short... this is much more of a pain than I thought it would be. obviously it is very likely I'm overlooking something very simple, but I can't find any documentation as to how to get the sdl port to work with the NDK and the SDK.

Original SDL ports of 1.2 came out before the NDK, and were made with a third-party toolchain. The port that was posted here might have been made with the NDK.
MBrening


Joined: 09 Nov 2009
Posts: 79
Location: Shawnee, Kansas
I'm guessing it does use GLES. That's what I understood from seeing the video code. I have the 1.6 NDK installed, and I tried setting the target to 1.5 and it would always error out. It wouldn't let me test it until I switched the target to 1.6

I'm wondering if there is another SDL port out there and I'm just not seeing it.

Then there is also the issue of not being able to get it to run even when i'm using 1.6 *shrug* maybe it just wasn't meant to be. At least programming "natively" for it doesn't look too hard.

nfries88 wrote:
MBrening wrote:
A couple issues I've run across. The port requires android 1.6 or higher. the droid phones from Verizon are currently on 1.5 with rumors of a 2.0 upgrade in the works. But until then, it means I can't run any of the programs on my current phone.

It does? Does it have a GLES backend, then? As far as I'm aware that's the only primary difference between 1.5 and 1.6 NDK.
Try just getting the headers and libs from the 1.6 NDK and using them with the 1.5 NDK. It might work fine.

Quote:
Long story short... this is much more of a pain than I thought it would be. obviously it is very likely I'm overlooking something very simple, but I can't find any documentation as to how to get the sdl port to work with the NDK and the SDK.

Original SDL ports of 1.2 came out before the NDK, and were made with a third-party toolchain. The port that was posted here might have been made with the NDK.