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
Status Update
Paul Hunkin
Guest

As requested, a status update on my GSoC project to port SDL to Android Smile

Initially I spent quite a while looking at various ways to achieve the
port. While I had a plan in mind as to how everything would work before
I started the project (based on C/GL code I'd previously written),
unfortunately recent changes in Android 2.1+ meant this was no longer
workable if we wanted a longer-term stable solution.

After trying a few methods of structuring SDL apps we eventually settled
on a system that the Android developers approved of and that would keep
SDL application logic intact (keeping control of the main-loop in C, for
example), and require no application-side code changes.

At this point I can run various simple GLES-based applications, and
process events (keyboard only at the moment, though I'm working on touch
events now). While it did take an annoyingly long time to get this far,
it should be a lot simpler from this point, as I am basically just
connecting up bits of Java-side Android to SDL and vice-versa.

So, the next major steps:
- Coordinate with the other GSoC people who are managing the new
multi-touch input system

- Other events (screen orientation change, for example)

- Implement the 2D (software/non-GL) drawing part of SDL. Various
methods exist for doing this - using the safest/stablest I am restricted
to some fairly slow methods on Android <2.2. In 2.2 I can map a Bitmap
object from Java to C so I can draw directly to the screen, in versions
before this I believe I will need to copy the generated framebuffer from
C to Java every frame.

- Port some non-trivial application(s). Suggestions welcome Smile

- Test on as many android devices as I can get my hands on.

Any questions or feedback, feel free to ask Smile

- Paul

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Status Update
Vittorio Giovara
Guest

this sounds like great stuff, keep it up Smile

On Thu, Jul 8, 2010 at 2:25 PM, Paul Hunkin wrote:
Quote:
As requested, a status update on my GSoC project to port SDL to Android Smile

Initially I spent quite a while looking at various ways to achieve the port.
While I had a plan in mind as to how everything would work before I started
the project (based on C/GL code I'd previously written), unfortunately
recent changes in Android 2.1+ meant this was no longer workable if we
wanted a longer-term stable solution.

After trying a few methods of structuring SDL apps we eventually settled on
a system that the Android developers approved of and that would keep SDL
application logic intact (keeping control of the main-loop in C, for
example), and require no application-side code changes.

At this point I can run various simple GLES-based applications, and process
events (keyboard only at the moment, though I'm working on touch events
now). While it did take an annoyingly long time to get this far, it should
be a lot simpler from this point, as I am basically just connecting up bits
of Java-side Android to SDL and vice-versa.

So, the next major steps:
- Coordinate with the other GSoC people who are managing the new multi-touch
input system

- Other events (screen orientation change, for example)

- Implement the 2D (software/non-GL) drawing part of SDL. Various methods
exist for doing this - using the safest/stablest I am restricted to some
fairly slow methods on Android <2.2. In 2.2 I can map a Bitmap object from
Java to C so I can draw directly to the screen, in versions before this I
believe I will need to copy the generated framebuffer from C to Java every
frame.

- Port some non-trivial application(s). Suggestions welcome Smile

- Test on as many android devices as I can get my hands on.

Any questions or feedback, feel free to ask Smile

- Paul

_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Nathaniel J Fries


Joined: 30 Mar 2010
Posts: 444
The choice in tying the Java APIs to C was the right idea to begin with. I'm sure there are ways around it through undocumented C functions and/or machine specific code, but doing it that way was best given that the system is built on Java.

I'd love to try it on my G1 (it still has Android 1.5, so it'd be a pretty good option for testing on older versions) but I'm pretty sure I won't have the time to test fully until this GSoC is over.