Google's Mobile Android OS - SDL?

Hi,

Any plans to port SDL to Google’s Android OS used in SmartPhones?
Just wondering, as there is an iPhone port already.
Thanks!

Jesse

There is apparently a port of SDL 1.2 to it, and I’ve asked the author
if he’s interested in porting 1.3, but I haven’t heard back.On Tue, Jan 12, 2010 at 8:52 AM, Jesse Palser wrote:

Hi,

Any plans to port SDL to Google’s Android OS used in SmartPhones?
Just wondering, as there is an iPhone port already.
Thanks!

Jesse


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Based on what people know of the Android platform, how difficult
does it seem to port an SDL app to an Android device? Is it possible
to actually run an app under the NDK (native development kit), or
is the NDK really just for porting libraries (e.g., so you do your
crazy math in C rather than in JITless Java)

-bill!On Tue, Jan 12, 2010 at 09:27:37PM -0800, Sam Lantinga wrote:

There is apparently a port of SDL 1.2 to it, and I’ve asked the author
if he’s interested in porting 1.3, but I haven’t heard back.

From what it says here, you cannot build complete applications C.

The official language is still Java.On Wed, Jan 13, 2010 at 6:53 PM, Bill Kendrick wrote:

On Tue, Jan 12, 2010 at 09:27:37PM -0800, Sam Lantinga wrote:

There is apparently a port of SDL 1.2 to it, and I’ve asked the author
if he’s interested in porting 1.3, but I haven’t heard back.

Based on what people know of the Android platform, how difficult
does it seem to port an SDL app to an Android device? Is it possible
to actually run an app under the NDK (native development kit), or
is the NDK really just for porting libraries (e.g., so you do your
crazy math in C rather than in JITless Java)

-bill!


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

From what it says here, you cannot build complete applications C.

http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html

The official language is still Java.

Well, there exists a (currently unofficial) port of ScummVM to
Android. Since ScummVM is C++, it apparently is possible.

See also http://sites.google.com/site/scummvmandroid/.

Cheers,
MaxAm 13.01.2010 um 19:27 schrieb Paulo Pinto:

I don’t have any android experience, but wouldn’t this only run in rooted
devices most likely?On Wed, Jan 13, 2010 at 9:25 PM, Max Horn wrote:

Am 13.01.2010 um 19:27 schrieb Paulo Pinto:

From what it says here, you cannot build complete applications C.

http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html

The official language is still Java.

Well, there exists a (currently unofficial) port of ScummVM to Android.
Since ScummVM is C++, it apparently is possible.

See also http://sites.google.com/site/scummvmandroid/.

Cheers,
Max


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

From what it says here, you cannot build complete applications C.

http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html

The official language is still Java.

Well, there exists a (currently unofficial) port of ScummVM to
Android. Since ScummVM is C++, it apparently is possible.
iirc the author did compile whole scummvm into a shared object and uses
jni to start it.
thats really the only way to get c/c++ apps running on the android,
unless its rooted of courseOn 01/13/2010 09:25 PM, Max Horn wrote:
Am 13.01.2010 um 19:27 schrieb Paulo Pinto:

So, as was said above, it’d need to be compiled to a .so and run through JNI. Doing so doesn’t decrease performance at all, or I wouldn’t think so at least, and I think that the NDK does this for you automatically (although I haven’t tried anything yet).from my understanding, Android will run any native code through JNI.

People are actually using SDL on the Android right now:
http://jiggawatt.org/badc0de/android/index.htmlOn Wed, Jan 13, 2010 at 3:25 PM, nfries88 wrote:

from my understanding, Android will run any native code through JNI.

So, as was said above, it’d need to be compiled to a .so and run through
JNI. Doing so doesn’t decrease performance at all, or I wouldn’t think so at
least, and I think that the NDK does this for you automatically (although I
haven’t tried anything yet).


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

yes, but this approach will not work on stock phones.

http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App
this is another approach to run native apps on android,
didnt test it yet but looks promising and should work on unmodified
phones tooOn 01/14/2010 06:01 AM, Sam Lantinga wrote:

People are actually using SDL on the Android right now:
http://jiggawatt.org/badc0de/android/index.html

I don’t have any android experience, but wouldn’t this only run in
rooted devices most likely?

No. ScummVM is available through the Android store for any android
phone, not just rooted ones.

As others explained, the trick is to use JNI; this is in fact
explained in the FAQ of the page I gave the link to.

Bye,
MaxAm 13.01.2010 um 21:37 schrieb Paulo Pinto:

Using JNI on Android is generally discouraged by Google though,
because Android was designed so that the application layer is
independent of the CPU architecture. By bypassing the managed VM and
running native code (ie. what JNI does) you are violating that
principle.

Of course, most (if not all?) of the Android devices on the market are
ARM right now, but if that ever changes…On Wed, Jan 13, 2010 at 18:25, nfries88 wrote:

from my understanding, Android will run any native code through JNI.

So, as was said above, it’d need to be compiled to a .so and run through
JNI. Doing so doesn’t decrease performance at all, or I wouldn’t think so at
least, and I think that the NDK does this for you automatically (although I
haven’t tried anything yet).


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

  • SR

Using JNI on Android is generally discouraged by Google though,
because Android was designed so that the application layer is
independent of the CPU architecture. By bypassing the managed VM and
running native code (ie. what JNI does) you are violating that
principle.

Sure, but it’s either that, or not running on that platform at all for
the majority of existing programs. So, while it may not be “pure” with
regards to this principle, it’s still a great way for many apps to be
ported to Android – I certainly prefer impure applications over non-
existing ones :-). In our case, it’s just not feasible to rewrite a
600,000 line C++ app in Java with limited man power, let alone keep
that rewrite in sync with the regular version :-).

Not to forget that in reality, very often Java programs still need to
be adapted to new platforms …

Of course, most (if not all?) of the Android devices on the market are
ARM right now, but if that ever changes…

… then one also provides versions for the new CPUs :slight_smile:

Cheers,
MaxAm 14.01.2010 um 22:40 schrieb Simon Roby:

I don’t have any prejudice against Java, but does anyone know if Google is
ever going to add JIT to Dalvik?

Without it, I wonder how fast you can really code games for Android.

My mobile phone has Symbian and the ARM processor provides Jazelle support,
so althought the games aren’t as
fast as pure native ones, they are quite fast already.

Now I wonder about Android phones.On Thu, Jan 14, 2010 at 11:04 PM, Max Horn wrote:

Am 14.01.2010 um 22:40 schrieb Simon Roby:

Using JNI on Android is generally discouraged by Google though,

because Android was designed so that the application layer is
independent of the CPU architecture. By bypassing the managed VM and
running native code (ie. what JNI does) you are violating that
principle.

Sure, but it’s either that, or not running on that platform at all for the
majority of existing programs. So, while it may not be “pure” with regards
to this principle, it’s still a great way for many apps to be ported to
Android – I certainly prefer impure applications over non-existing ones
:-). In our case, it’s just not feasible to rewrite a 600,000 line C++ app
in Java with limited man power, let alone keep that rewrite in sync with the
regular version :-).

Not to forget that in reality, very often Java programs still need to be
adapted to new platforms …

Of course, most (if not all?) of the Android devices on the market are
ARM right now, but if that ever changes…

… then one also provides versions for the new CPUs :slight_smile:

Cheers,
Max


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

Paulo,

which JDKs you know of use Jazelle support? I’m not aware of any active
ones… I’ve searched before but came up empty!

-AlanOn 1/14/2010 2:25 PM, Paulo Pinto wrote:

I don’t have any prejudice against Java, but does anyone know if
Google is ever going to add JIT to Dalvik?

Without it, I wonder how fast you can really code games for Android.

My mobile phone has Symbian and the ARM processor provides Jazelle
support, so althought the games aren’t as
fast as pure native ones, they are quite fast already.

Now I wonder about Android phones.

On Thu, Jan 14, 2010 at 11:04 PM, Max Horn <max at quendi.de <mailto:max at quendi.de>> wrote:

Am 14.01.2010 um 22:40 schrieb Simon Roby:

    Using JNI on Android is generally discouraged by Google though,
    because Android was designed so that the application layer is
    independent of the CPU architecture. By bypassing the managed
    VM and
    running native code (ie. what JNI does) you are violating that
    principle.


Sure, but it's either that, or not running on that platform at all
for the majority of existing programs. So, while it may not be
"pure" with regards to this principle, it's still a great way for
many apps to be ported to Android -- I certainly prefer impure
applications over non-existing ones :-). In our case, it's just
not feasible to rewrite a 600,000 line C++ app in Java with
limited man power, let alone keep that rewrite in sync with the
regular version :-).

Not to forget that in reality, very often Java programs still need
to be adapted to new platforms ...


    Of course, most (if not all?) of the Android devices on the
    market are
    ARM right now, but if that ever changes...


... then one also provides versions for the new CPUs :)

Cheers,
Max
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto: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

Well, surely Nokia JVM does it (I cannot prove that, I am no longer a Nokia
employee)

And Sun HotSpot does it as well:

http://java.sun.com/javame/reference/docs/cldc-hi-2.0-web/doc/release/CLDC_HI-release-notes.html#jazelleOn Fri, Jan 15, 2010 at 1:31 AM, Alan Carr <alan.m.carr at gmail.com> wrote:

Paulo,

which JDKs you know of use Jazelle support? I’m not aware of any active
ones… I’ve searched before but came up empty!

-Alan

On 1/14/2010 2:25 PM, Paulo Pinto wrote:

I don’t have any prejudice against Java, but does anyone know if Google is
ever going to add JIT to Dalvik?

Without it, I wonder how fast you can really code games for Android.

My mobile phone has Symbian and the ARM processor provides Jazelle support,
so althought the games aren’t as
fast as pure native ones, they are quite fast already.

Now I wonder about Android phones.

On Thu, Jan 14, 2010 at 11:04 PM, Max Horn wrote:

Am 14.01.2010 um 22:40 schrieb Simon Roby:

Using JNI on Android is generally discouraged by Google though,

because Android was designed so that the application layer is
independent of the CPU architecture. By bypassing the managed VM and
running native code (ie. what JNI does) you are violating that
principle.

Sure, but it’s either that, or not running on that platform at all for the
majority of existing programs. So, while it may not be “pure” with regards
to this principle, it’s still a great way for many apps to be ported to
Android – I certainly prefer impure applications over non-existing ones
:-). In our case, it’s just not feasible to rewrite a 600,000 line C++ app
in Java with limited man power, let alone keep that rewrite in sync with the
regular version :-).

Not to forget that in reality, very often Java programs still need to be
adapted to new platforms …

Of course, most (if not all?) of the Android devices on the market are
ARM right now, but if that ever changes…

… then one also provides versions for the new CPUs :slight_smile:

Cheers,
Max


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


SDL mailing listSDL at lists.libsdl.orghttp://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

from wikipedia:
Dalvik currently has no just-in-time compiler
http://en.wikipedia.org/wiki/Just-in-time_compilation, although there
is an experimental JIT compiler available.

and its certainly on the roadmap:
http://groups.google.com/group/android-platform/browse_thread/thread/331d5f5636f5f532On 01/14/2010 11:25 PM, Paulo Pinto wrote:

I don’t have any prejudice against Java, but does anyone know if
Google is ever going to add JIT to Dalvik?

Interesting reading, thanks for the pointers.On Fri, Jan 15, 2010 at 10:50 PM, Marcel Wysocki wrote:

On 01/14/2010 11:25 PM, Paulo Pinto wrote:

I don’t have any prejudice against Java, but does anyone know if Google is
ever going to add JIT to Dalvik?

from wikipedia:
Dalvik currently has no just-in-time compilerhttp://en.wikipedia.org/wiki/Just-in-time_compilation,
although there is an experimental JIT compiler available.

and its certainly on the roadmap:

http://groups.google.com/group/android-platform/browse_thread/thread/331d5f5636f5f532


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

Hello
so whats the status on SDL on Android OS/NDK ?
(has it been ported and does it support using opengl with SDL ?)
Thanks

Would SDL really make sense on Android? Last time I checked you’re not
supposed to write native C/C++ apps on Android.On Tue, Mar 30, 2010 at 12:41, Tiresias wrote:

Hello
so whats the status on SDL on Android OS/NDK ?
(has it been ported and does it support using opengl with SDL ?)
Thanks


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

  • SR