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 for Android: compile but don't work
globoeil


Joined: 03 Dec 2009
Posts: 20
Hello there

I work with MacOSX (10.6), and want to use SDL on my Android phone (v1.6).
I use NDK and ndk-build to build the binary.
I downloaded the demo project android-project.zip
I can easily compile and send the program to the emulator or the device,
but it just launch and exit immediatly.

Here is the adb logcat:

I/ActivityManager( 6Cool: Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.libsdl.app/.SDLActivity }
I/ActivityManager( 6Cool: Start proc org.libsdl.app for activity org.libsdl.app/.SDLActivity: pid=284 uid=10024 gids={1015}
I/jdwp ( 284): received file descriptor 20 from ADB
D/ddm-heap( 284): Got feature list request
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm( 284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libSDL.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm( 284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm( 284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm( 284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm( 284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm( 284): Trying to load lib /data/data/org.libsdl.app/lib/libmain.so 0x43954b80
D/dalvikvm( 284): Added shared lib /data/data/org.libsdl.app/lib/libmain.so 0x43954b80
D/qemud ( 35): fdhandler_accept_event: accepting on fd 10
D/qemud ( 35): created client 0x17fc8 listening on fd 15
D/qemud ( 35): client_fd_receive: attempting registration for service 'sensors'
D/qemud ( 35): client_fd_receive: -> received channel id 11
D/qemud ( 35): client_registration: registration succeeded for client 11
D/qemud ( 35): fdhandler_event: disconnect on fd 15
D/SensorManager( 284): found sensor: Goldfish 3-axis Accelerometer, handle=0
E/JavaBinder( 284): !!! FAILED BINDER TRANSACTION !!!
V/SDL ( 284): pixel format unknown -1
E/SensorManager( 284): mDataChannel == NULL, exiting
D/dalvikvm( 284): +++ not scanning '/system/lib/libwebcore.so' for 'onNativeResize' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libmedia_jni.so' for 'onNativeResize' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libexif.so' for 'onNativeResize' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libFFTEm.so' for 'onNativeResize' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libwebcore.so' for 'nativeInit' (wrong CL)
I/SDL ( 284): SDL_Android_Init()
V/SDL ( 284): SDL audio: opening device
V/SDL ( 284): SDL audio: wanted mono 8-bit 11.025kHz, 512 frames buffer
I/ActivityManager( 6Cool: Displayed activity org.libsdl.app/.SDLActivity: 1384 ms (total 1384 ms)
D/dalvikvm( 284): +++ not scanning '/system/lib/libwebcore.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libmedia_jni.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libexif.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm( 284): +++ not scanning '/system/lib/libFFTEm.so' for 'nativeRunAudioThread' (wrong CL)
V/SDL ( 284): SDL audio: got mono 8-bit 11.025kHz, 512 frames buffer
I/SDL ( 284): [STUB] GL_LoadLibrary
V/SDL ( 284): Starting up
E/libEGL ( 284): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)
I/SDL ( 284): [STUB] GL_SetSwapInterval
I/SDL ( 284): [STUB] GL_GetSwapInterval
I/SDL ( 284): [STUB] GL_GetProcAddress
I/SDL ( 284): [STUB] GL_GetProcAddress
I/ARMAssembler( 284): generated scanline__00000177:03010144_00000004_00000000 [ 35 ipp] (57 ins) at [0x2690a0:0x269184] in 771000 ns
V/SDL ( 284): Finished waiting for audio thread
I/SDL ( 284): [STUB] GL_UnloadLibrary
I/ActivityManager( 6Cool: Process org.libsdl.app (pid 284) has died.
I/WindowManager( 6Cool: WIN DEATH: Window{437c6ca8 org.libsdl.app/org.libsdl.app.SDLActivity paused=false}
I/WindowManager( 6Cool: WIN DEATH: Window{438c7c50 SurfaceView paused=false}
W/AudioFlinger( 31): write blocked for 84 msecs
W/UsageStats( 6Cool: Unexpected resume of com.android.launcher while already resumed in org.libsdl.app
W/InputManagerService( 6Cool: Got RemoteException sending setActive(false) notification to pid 284 uid 10024




I didn't edited anything in the original source code, just did "ndk-build", and then imported using Eclipse like explained in README.android:

“Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
* File -> New -> Other
* Select the Android -> Android Project wizard and click Next
* Enter the name you'd like your project to have
* Select "Create project from existing source" and browse for your project directory
* Make sure the Build Target is set to Android 1.6
* Click Finish”


I can't understand, can you help me please? (Emulator is default android 1.6)


Thank you all
SDL for Android: compile but don't work
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
I just updated the Eclipse plugins, the Android tools, the API SDKs, NDK to r5b, removed all my old virtual machines and created a new Android 2.1 virtual machine with 64 MB SDcard and otherwise default settings.

The I updated the demo project with the latest SDL and ran the following steps while the new emulator was running:
ndk-build
ant install
sh data.sh      <-- important!

I then ran the SDL application on the emulator and blasted some aliens. :)

Here's the demo project with the latest SDL:
http://www.libsdl.org/tmp/android-project.zip

See ya!

On Mon, Mar 14, 2011 at 1:35 AM, Globoeil wrote:
Quote:
Hello there
 
I work with MacOSX (10.6), and want to use SDL on my Android phone (v1.6).
I use NDK and ndk-build to build the binary.
I downloaded the demo project android-project.zip
I can easily compile and send the program to the emulator or the device,
but it just launch and exit immediatly.
 
Here is the adb logcat:
 
I/ActivityManager(   6Cool: Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.libsdl.app/.SDLActivity }
I/ActivityManager(   6Cool: Start proc org.libsdl.app for activity org.libsdl.app/.SDLActivity: pid=284 uid=10024 gids={1015}
I/jdwp    (  284): received file descriptor 20 from ADB
D/ddm-heap(  284): Got feature list request
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm(  284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libmikmod.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libSDL.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm(  284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_image.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm(  284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_mixer.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm(  284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_ttf.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm(  284): No JNI_OnLoad found in /data/data/org.libsdl.app/lib/libSDL_net.so 0x43954b80
D/dalvikvm(  284): Trying to load lib /data/data/org.libsdl.app/lib/libmain.so 0x43954b80
D/dalvikvm(  284): Added shared lib /data/data/org.libsdl.app/lib/libmain.so 0x43954b80
D/qemud   (   35): fdhandler_accept_event: accepting on fd 10
D/qemud   (   35): created client 0x17fc8 listening on fd 15
D/qemud   (   35): client_fd_receive: attempting registration for service 'sensors'
D/qemud   (   35): client_fd_receive:    -> received channel id 11
D/qemud   (   35): client_registration: registration succeeded for client 11
D/qemud   (   35): fdhandler_event: disconnect on fd 15
D/SensorManager(  284): found sensor: Goldfish 3-axis Accelerometer, handle=0
E/JavaBinder(  284): !!! FAILED BINDER TRANSACTION !!!
V/SDL     (  284): pixel format unknown -1
E/SensorManager(  284): mDataChannel == NULL, exiting
D/dalvikvm(  284): +++ not scanning '/system/lib/libwebcore.so' for 'onNativeResize' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libmedia_jni.so' for 'onNativeResize' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libexif.so' for 'onNativeResize' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libFFTEm.so' for 'onNativeResize' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libwebcore.so' for 'nativeInit' (wrong CL)
I/SDL     (  284): SDL_Android_Init()
V/SDL     (  284): SDL audio: opening device
V/SDL     (  284): SDL audio: wanted mono 8-bit 11.025kHz, 512 frames buffer
I/ActivityManager(   6Cool: Displayed activity org.libsdl.app/.SDLActivity: 1384 ms (total 1384 ms)
D/dalvikvm(  284): +++ not scanning '/system/lib/libwebcore.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libmedia_jni.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libexif.so' for 'nativeRunAudioThread' (wrong CL)
D/dalvikvm(  284): +++ not scanning '/system/lib/libFFTEm.so' for 'nativeRunAudioThread' (wrong CL)
V/SDL     (  284): SDL audio: got mono 8-bit 11.025kHz, 512 frames buffer
I/SDL     (  284): [STUB] GL_LoadLibrary
V/SDL     (  284): Starting up
E/libEGL  (  284): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)
I/SDL     (  284): [STUB] GL_SetSwapInterval
I/SDL     (  284): [STUB] GL_GetSwapInterval
I/SDL     (  284): [STUB] GL_GetProcAddress
I/SDL     (  284): [STUB] GL_GetProcAddress
I/ARMAssembler(  284): generated scanline__00000177:03010144_00000004_00000000 [ 35 ipp] (57 ins) at [0x2690a0:0x269184] in 771000 ns
V/SDL     (  284): Finished waiting for audio thread
I/SDL     (  284): [STUB] GL_UnloadLibrary
I/ActivityManager(   6Cool: Process org.libsdl.app (pid 284) has died.
I/WindowManager(   6Cool: WIN DEATH: Window{437c6ca8 org.libsdl.app/org.libsdl.app.SDLActivity paused=false}
I/WindowManager(   6Cool: WIN DEATH: Window{438c7c50 SurfaceView paused=false}
W/AudioFlinger(   31): write blocked for 84 msecs
W/UsageStats(   6Cool: Unexpected resume of com.android.launcher while already resumed in org.libsdl.app
W/InputManagerService(   6Cool: Got RemoteException sending setActive(false) notification to pid 284 uid 10024

 
 
 
I didn't edited anything in the original source code, just did "ndk-build", and then imported using Eclipse like explained in README.android:
 
“Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
* File -> New -> Other
* Select the Android -> Android Project wizard and click Next
* Enter the name you'd like your project to have
* Select "Create project from existing source" and browse for your project directory
* Make sure the Build Target is set to Android 1.6
* Click Finish”

 
I can't understand, can you help me please? (Emulator is default android 1.6)
 
 
Thank you all [img][/img]




_______________________________________________
SDL mailing list

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




--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
SDL for Android: compile but don't work
Neil White
Guest

just working on trying to finish a pure android game right now!



is this SDL only going to run 2.2 above?
SDL for Android: compile but don't work
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
It actually supports 1.6 and above, but the OpenGL ES 2 renderer requires 2.1.

On Tue, Mar 15, 2011 at 11:56 PM, Neil White wrote:
Quote:
just working on trying to finish a pure android game right now!



is this SDL only going to run 2.2 above?

_______________________________________________
SDL mailing list

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




--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
SDL for Android: compile but don't work
René Dudfield
Guest

Hi,

Note that r5b apparently hangs on pre 2.2 phones.  r4b is the one I've seen used with the other SDL port.  But they are fairly different sdks.

cya,


On Wed, Mar 16, 2011 at 8:07 AM, Sam Lantinga wrote:
Quote:
It actually supports 1.6 and above, but the OpenGL ES 2 renderer requires 2.1.

On Tue, Mar 15, 2011 at 11:56 PM, Neil White wrote:

Quote:
just working on trying to finish a pure android game right now!



is this SDL only going to run 2.2 above?


_______________________________________________
SDL mailing list

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






--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks




_______________________________________________
SDL mailing list

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

SDL for Android: compile but don't work
globoeil


Joined: 03 Dec 2009
Posts: 20
Thank you, it works now

From: René Dudfield
Sent: Wednesday, March 16, 2011 12:05 PM
To: SDL Development List
Subject: Re: [SDL] SDL for Android: compile but don't work




Hi,

Note that r5b apparently hangs on pre 2.2 phones. r4b is the one I've seen used with the other SDL port. But they are fairly different sdks.

cya,


On Wed, Mar 16, 2011 at 8:07 AM, Sam Lantinga wrote:
Quote:
It actually supports 1.6 and above, but the OpenGL ES 2 renderer requires 2.1.

On Tue, Mar 15, 2011 at 11:56 PM, Neil White wrote:

Quote:
just working on trying to finish a pure android game right now!


is this SDL only going to run 2.2 above?


_______________________________________________
SDL mailing list

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






--
-Sam Lantinga, Founder and CEO, Galaxy Gameworks




_______________________________________________
SDL mailing list

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




_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL for Android: compile but don't work
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Glad to hear it! :)

On Wed, Mar 16, 2011 at 1:34 PM, Globoeil wrote:
Quote:
Thank you, it works now [img][/img]
 
From: René Dudfield
Sent: Wednesday, March 16, 2011 12:05 PM
To: SDL Development List
Subject: Re: [SDL] SDL for Android: compile but don't work


 


Hi,

Note that r5b apparently hangs on pre 2.2 phones.  r4b is the one I've seen used with the other SDL port.  But they are fairly different sdks.

cya,


On Wed, Mar 16, 2011 at 8:07 AM, Sam Lantinga wrote:
Quote:
It actually supports 1.6 and above, but the OpenGL ES 2 renderer requires 2.1.

On Tue, Mar 15, 2011 at 11:56 PM, Neil White wrote:

Quote:
just working on trying to finish a pure android game right now!

 
is this SDL only going to run 2.2 above?
 

_______________________________________________
SDL mailing list

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






--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks




_______________________________________________
SDL mailing list

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






_______________________________________________
SDL mailing list

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






_______________________________________________
SDL mailing list

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




--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
SDL for Android: compile but don't work
Neil White
Guest

can someone give me a rundown on what this actually 'does' with regard to playing nice with the android GUI etc