SDL port for Android SDK/NDK 1.6

Quickly share your Android Code Snippets here...

Re: SDL port for Android SDK/NDK 1.6

Postby T-1000 » Tue Sep 06, 2011 7:51 pm

great! now i have 18 - 22 FPS!
many thanks (again)
T-1000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Nov 12, 2010 12:10 pm

Top

Re: SDL port for Android SDK/NDK 1.6

Postby Omnigraphical » Tue Sep 06, 2011 10:28 pm

Hello there!

I've been working on a pelyaSDL based JaggedAlliance2 port for some time now. It has reached early Beta stage, but it has severe issues with speed and some texts on most devices. Only one tester has reported flawless gameplay (on Acer Liquid).
I don't know why the results are so different (my HTCDesire has speed issues and text-rendering issues).
I used version 8e16ec9f333ca3bbe11b15e1d2e0ae9e9d4b64be from the pelyaSDL github repo and Crystax_ndk6_2 for compiling.
The forum I posted my beta is here: http://www.ja-galaxy-forum.com/board/ub ... Post290376

If anyone of you has the time to test it, or has ideas/hints on solving the speed/text issues, please let me know!
Omnigraphical
Developer
Developer
 
Posts: 27
Joined: Sun Jan 30, 2011 11:50 pm
Location: Germany

Re: SDL port for Android SDK/NDK 1.6

Postby jonbonazza » Thu Sep 08, 2011 3:47 am

I am attempting to build the official SDL 1.3 port, and althought libSDL builds fine, when I go to compile the SDL_android_main.cpp file, it keeps giving me the error "undefined reference to SDL_Main" and points to line 30 which is:

Code: Select all

status = SDL_main(1, argv);


What am I doing wrong?
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Thu Sep 08, 2011 9:08 am

Rename your main() to SDL_main(), or #inlclude <SDL/SDL.h> in the file where your main() is defined.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby T-1000 » Fri Sep 09, 2011 8:59 pm

When I loose application focus (phone alarm activates) I am trying to recover it by re-initing GL and loading all the textures, I am not able to recover the same status as before, some textures work but some don't also the app is not able to render quads as before this...

Here is what i am doing:

Code: Select all
#ifdef ANDROID
/* Phone external events */
        if(event.type == SDL_ACTIVEEVENT && event.active.gain == 0 && event.active.state & SDL_APPACTIVE )
        {
            while(true)
            {
                SDL_PollEvent(&event);
                if(event.type == SDL_ACTIVEEVENT && event.active.gain && event.active.state & SDL_APPACTIVE )
                {
                    SDL_GL_SwapBuffers();
                    SDL_Flip(SDL_GetVideoSurface());
                    initGL(); // Same as when the game is started
                    deleteTextures(); // delete all textures being used
                    loadLevelData(); // re-create all textures
                    flushEvents(); // flush pending events
                    break;
                }
                SDL_Delay(300);
            }
        }
#endif


i cannot figure out what is wrong. :(
Any ideas?
T-1000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Nov 12, 2010 12:10 pm

Re: SDL port for Android SDK/NDK 1.6

Postby gjtorikian » Sun Sep 11, 2011 6:02 pm

I suspect that the newer changes have broken something for my Tegra2 powered device. The exact same C code I've been using for awhile now no longer runs.

Here's my crappily unhelpful logcat:

Code: Select all
I/System.out(24690): libSDL: Creating startup screen
D/dalvikvm(24690): GC_EXTERNAL_ALLOC freed 63K, 50% free 2707K/5379K, external 0K/0K, paused 32ms
D/dalvikvm(24690): GC_EXTERNAL_ALLOC freed 5K, 50% free 2712K/5379K, external 50K/522K, paused 22ms
D/dalvikvm(24690): GC_EXTERNAL_ALLOC freed <1K, 50% free 2712K/5379K, external 525K/1037K, paused 18ms
I/System.out(24690): libSDL: Loading libraries
I/System.out(24690): libSDL: loaded GLESv2 lib
I/System.out(24690): libSDL: loading lib /data/data/com.miadzin.nb/files/../lib/libsdl-1.2.so
D/dalvikvm(24690): Trying to load lib /data/data/com.miadzin.nb/files/../lib/libsdl-1.2.so 0x40513b48
D/dalvikvm(24690): Added shared lib /data/data/com.miadzin.nb/files/../lib/libsdl-1.2.so 0x40513b48
I/System.out(24690): libSDL: loading lib /data/data/com.miadzin.nb/files/../lib/libsdl_ttf.so
D/dalvikvm(24690): Trying to load lib /data/data/com.miadzin.nb/files/../lib/libsdl_ttf.so 0x40513b48
D/dalvikvm(24690): Added shared lib /data/data/com.miadzin.nb/files/../lib/libsdl_ttf.so 0x40513b48
D/dalvikvm(24690): No JNI_OnLoad found in /data/data/com.miadzin.nb/files/../lib/libsdl_ttf.so 0x40513b48, skipping init
I/System.out(24690): libSDL: loading lib /data/data/com.miadzin.nb/files/../lib/libsdl_mixer.so
D/dalvikvm(24690): Trying to load lib /data/data/com.miadzin.nb/files/../lib/libsdl_mixer.so 0x40513b48
D/dalvikvm(24690): Added shared lib /data/data/com.miadzin.nb/files/../lib/libsdl_mixer.so 0x40513b48
D/dalvikvm(24690): No JNI_OnLoad found in /data/data/com.miadzin.nb/files/../lib/libsdl_mixer.so 0x40513b48, skipping init
I/System.out(24690): libSDL: Loading settings
I/System.out(24690): libSDL: Settings.Load(): enter
I/System.out(24690): libSDL: Settings.Load(): loading settings failed, running config dialog
I/System.out(24690): libSDL: stdout-test passed, your libc seems to be good
I/System.out(24690): libSDL: Starting data downloader
I/System.out(24690): libSDL: Starting downloader
I/System.out(24690): libSDL: Initializing video and SDL application
I/System.out(24690): libSDL: DemoRenderer: RatelimitTouchEvents false
I/ActivityManager( 1045): Displayed com.miadzin.nb/.MainActivity: +522ms
V/SDL     (24690): GLSurfaceView_SDL::EglHelper::start(): creating GL context
D/libEGL  (24690): loaded /system/lib/egl/libGLES_android.so
D/libEGL  (24690): loaded /system/lib/egl/libEGL_tegra.so
W/IInputConnectionWrapper( 1172): showStatusIcon on inactive InputConnection
D/libEGL  (24690): loaded /system/lib/egl/libGLESv1_CM_tegra.so
D/libEGL  (24690): loaded /system/lib/egl/libGLESv2_tegra.so
V/SDL     (24690): GL config 0: R5G6B5A0 depth 0 stencil 0 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 1: R5G6B5A0 depth 0 stencil 8 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 2: R5G6B5A0 depth 16 stencil 0 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 3: R5G6B5A0 depth 16 stencil 8 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 4: R8G8B8A8 depth 0 stencil 0 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 5: R8G8B8A8 depth 0 stencil 8 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 6: R8G8B8A8 depth 16 stencil 0 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 7: R8G8B8A8 depth 16 stencil 8 renderable type 7( GLES GLES2 OPENVG )
V/SDL     (24690): GL config 8: R5G6B5A0 depth 0 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 9: R5G6B5A0 depth 16 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 10: R8G8B8A0 depth 0 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 11: R8G8B8A0 depth 16 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 12: R8G8B8A8 depth 0 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 13: R8G8B8A8 depth 16 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 14: R0G0B0A8 depth 0 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GL config 15: R0G0B0A8 depth 16 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GLSurfaceView_SDL::EGLConfigChooser::chooseConfig(): selected 8: R5G6B5A0 depth 0 stencil 0 renderable type 1( GLES )
V/SDL     (24690): GLSurfaceView_SDL::EglHelper::createSurface(): creating GL context
I/System.out(24690): libSDL: DemoRenderer.onSurfaceCreated(): paused false mFirstTimeStart true
I/libSDL  (24690): Physical screen resolution is 800x480, virtual screen 800x480
D/dalvikvm(24690): GC_CONCURRENT freed 324K, 51% free 2809K/5639K, external 1595K/1631K, paused 2ms+2ms
D/dalvikvm(24690): GC_EXTERNAL_ALLOC freed 3K, 51% free 2805K/5639K, external 1545K/1631K, paused 20ms
I/ARMAssembler(24690): generated scanline__00000177:03010104_00009001_00000000 [119 ipp] (144 ins) at [0x454d61e8:0x454d6428] in 144000 ns
D/dalvikvm(24690): Trying to load lib /mnt/asec/com.miadzin.nb-1/lib/libapplication.so 0x40513b48
D/dalvikvm(24690): Added shared lib /mnt/asec/com.miadzin.nb-1/lib/libapplication.so 0x40513b48
D/dalvikvm(24690): No JNI_OnLoad found in /mnt/asec/com.miadzin.nb-1/lib/libapplication.so 0x40513b48, skipping init
D/dalvikvm(24690): Trying to load lib /mnt/asec/com.miadzin.nb-1/lib/libsdl_main.so 0x40513b48
D/dalvikvm(24690): Added shared lib /mnt/asec/com.miadzin.nb-1/lib/libsdl_main.so 0x40513b48
D/dalvikvm(24690): No JNI_OnLoad found in /mnt/asec/com.miadzin.nb-1/lib/libsdl_main.so 0x40513b48, skipping init
I/System.out(24690): libSDL: setting envvar LANGUAGE to 'en_US'
I/System.out(24690): libSDL: accelerometer start required: false
I/libSDL  (24690): Changing curdir to "/mnt/sdcard/app-data/com.miadzin.nb"
I/libSDL  (24690): Calling SDL_main("/mnt/sdcard/app-data/com.miadzin.nb/data")
I/libSDL  (24690): param 0 = "/mnt/sdcard/app-data/com.miadzin.nb/data"
E/libSDL  (24690): ERROR: There are 1 joysticks available
I/libSDL  (24690): ANDROIDAUD_OpenAudio(): app requested audio bytespersample 2 freq 44100 channels 2 samples 480
D/AudioFlinger(  976): setParameters(): io 0, keyvalue nv_a2dp_routing=0, tid 1036, calling tid 976
W/        (  976): @@(Device.cpp-hal)@@ setOutputDevice(), device is 0 return
D/AudioFlinger(  976): setParameters(): io 0, keyvalue MUSIC_VOLUME=6, tid 1036, calling tid 976
I/libSDL  (24690): ANDROIDAUD_OpenAudio(): app opened audio bytespersample 2 freq 44100 channels 2 bufsize 1920
W/        (  976): @@(Device.cpp-hal)@@ setOutputMute(force unmute)
D/        (  980): @@(Audiofx_transport)@@   NvAudioFxNotifierThread()-IoDeviceVolume, IoDevice=256, LeftVolume=-1462603889, RightVolume=1081126168, Mute=0        CHR_TEST!!

I/libSDL  (24690): SDL_SetVideoMode(): application requested mode 480x800 OpenGL 2 HW 0 BPP 16
D/        (  980): @@(Audiofx_transport)@@    NvAudioFxNotifierThread() - NvAudioFxEventPowerStateChange - NvAudioFxPowerState_Full        CHR_TEST!!

D/        (  980): @@(Audiofx_transport)@@   SetPower() Port = 2, IsEnable = 1      CHR_TEST!!

D/        (  980): @@(Audiofx_transport)@@   SetPower() Port = 1, IsEnable = 1      CHR_TEST!!

D/        (  980): @@(Audiofx_transport)@@   SetPower() Port = 8, IsEnable = 1      CHR_TEST!!

D/        (  980): @@(Audiofx_transport)@@   SetAudioPort() PortDirection = 2, IsEnable =1      CHR_TEST!!

D/        (  980): @@(Audiofx_transport)@@    NvAudioFxNotifierThread() - NvAudioFxEventPowerStateChange - NvAudioFxPowerState_Low        CHR_TEST!!

E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
E/libEGL  (24690): called unimplemented OpenGL ES API
I/ARMAssembler(24690): generated scanline__00000177:03545444_00009101_00000000 [159 ipp] (215 ins) at [0x454d6430:0x454d678c] in 312000 ns
I/ARMAssembler(24690): generated scanline__00000177:03111144_00009003_00000000 [ 86 ipp] (129 ins) at [0x454d6790:0x454d6994] in 116000 ns
I/ARMAssembler(24690): generated scanline__00000177:03545444_00009001_00000000 [159 ipp] (215 ins) at [0x454d6998:0x454d6cf4] in 306000 ns
I/ARMAssembler(24690): generated scanline__00000177:03545444_00009503_00000000 [ 90 ipp] (142 ins) at [0x454d6cf8:0x454d6f30] in 154000 ns
I/ARMAssembler(24690): generated scanline__00000177:03545444_00009501_00000000 [160 ipp] (216 ins) at [0x454d6f38:0x454d7298] in 284000 ns
I/DEBUG   (  973): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  973): Build fingerprint: 'lge/lge_lge_star/p999:2.3.3/GRI40/lgp999-V21e.41fdc8a2:user/release-keys'
I/DEBUG   (  973): pid: 24690, tid: 24703  >>> com.miadzin.nb <<<
I/DEBUG   (  973): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 45287004
I/DEBUG   (  973):  r0 00174fe0  r1 0000001f  r2 45287004  r3 aab93b10
I/DEBUG   (  973):  r4 00000040  r5 00000080  r6 00aa003b  r7 00000020
I/DEBUG   (  973):  r8 00000020  r9 2a8024c0  10 00ff00ff  fp fffec7f8
I/DEBUG   (  973):  ip 2e400400  sp 44e968b8  lr 452f1c3c  pc 454d711c  cpsr 60000010
I/DEBUG   (  973):  d0  3f13cd38ffc00000  d1  be4cd70b3f800000
I/DEBUG   (  973):  d2  ffc00000ffc00000  d3  bf2f9cc97fc00000
I/DEBUG   (  973):  d4  3f8000003f116c46  d5  fff8000000000000
I/DEBUG   (  973):  d6  7ff8000000000000  d7  fff8000000000000
I/DEBUG   (  973):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  973):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  973):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  973):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  973):  scr 30000013
I/DEBUG   (  973):
I/System.out(24499): [INFO:215746]: LogSource: Running delayed flush
I/System.out(24499): [INFO:215756]: LogSource: Running flush
I/DEBUG   (  973):          #00  pc 454d711c  /dev/ashmem/mspace (deleted)
I/DEBUG   (  973):          #01  lr 452f1c3c  <unknown>
I/DEBUG   (  973):
I/DEBUG   (  973): code around pc:
I/DEBUG   (  973): 454d70fc e1640887 e00a6003 e1a04224 e02cc496
I/DEBUG   (  973): 454d710c e00a6423 e0299496 e0455004 e2688040
I/DEBUG   (  973): 454d711c e5923000 e1640887 e00a6003 e1a04224
I/DEBUG   (  973): 454d712c e02cc496 e00a6423 e0299496 e5903400
I/DEBUG   (  973): 454d713c e7923003 e0454004 e00a6003 e02cc496
I/DEBUG   (  973):
I/DEBUG   (  973): code around lr:
I/DEBUG   (  973): 452f1c1c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   (  973): 452f1c2c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   (  973): 452f1c3c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   (  973): 452f1c4c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   (  973): 452f1c5c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   (  973):
I/DEBUG   (  973): stack:
I/DEBUG   (  973):     44e96878  00080001 
I/DEBUG   (  973):     44e9687c  10020000 
I/DEBUG   (  973):     44e96880  00000302 
I/DEBUG   (  973):     44e96884  ff318e90 
I/DEBUG   (  973):     44e96888  ffffa406 
I/DEBUG   (  973):     44e9688c  0000189c 
I/DEBUG   (  973):     44e96890  44e96904 
I/DEBUG   (  973):     44e96894  00000000 
I/DEBUG   (  973):     44e96898  44e96914 
I/DEBUG   (  973):     44e9689c  00174fe0 
I/DEBUG   (  973):     44e968a0  0000189c 
I/DEBUG   (  973):     44e968a4  ff7d705a 
I/DEBUG   (  973):     44e968a8  ffffa406 
I/DEBUG   (  973):     44e968ac  f447b805 
I/DEBUG   (  973):     44e968b0  df002777 
I/DEBUG   (  973):     44e968b4  e3a070ad 
I/DEBUG   (  973): #00 44e968b8  00174fe0 
I/DEBUG   (  973):     44e968bc  00000320 
I/DEBUG   (  973):     44e968c0  00000000 
I/DEBUG   (  973):     44e968c4  01bdc5a5 
I/DEBUG   (  973):     44e968c8  01bdcb2f 
I/DEBUG   (  973):     44e968cc  fffec7f4 
I/DEBUG   (  973):     44e968d0  0000016d 
I/DEBUG   (  973):     44e968d4  ac90acb8  /system/lib/libpixelflinger.so
I/DEBUG   (  973):     44e968d8  00000008 
I/DEBUG   (  973):     44e968dc  00001df8 
I/DEBUG   (  973):     44e968e0  e44f7095 
I/DEBUG   (  973):     44e968e4  00001898 
I/DEBUG   (  973):     44e968e8  44e9690c 
I/DEBUG   (  973):     44e968ec  00000008 
I/DEBUG   (  973):     44e968f0  44e9691c 
I/DEBUG   (  973):     44e968f4  44e968fc 
I/DEBUG   (  973):     44e968f8  ab6db8bf 
I/DEBUG   (  973):     44e968fc  ffffaa07 
D/dalvikvm( 1045): GC_EXPLICIT freed 1176K, 44% free 7184K/12615K, external 2478K/3084K, paused 90ms
I/BootReceiver( 1045): Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
D/Zygote  (  975): Process 24690 terminated by signal (11)
E/InputDispatcher( 1045): channel '40a61aa8 com.miadzin.nb/com.miadzin.nb.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
E/InputDispatcher( 1045): channel '40a61aa8 com.miadzin.nb/com.miadzin.nb.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
D/AudioFlinger(  976): setParameters(): io 0, keyvalue nv_a2dp_routing=0, tid 1036, calling tid 976
W/        (  976): @@(Device.cpp-hal)@@ setOutputDevice(), device is 0 return
I/WindowManager( 1045): WINDOW DIED Window{40a61aa8 com.miadzin.nb/com.miadzin.nb.MainActivity paused=false}
I/ActivityManager( 1045): Process com.miadzin.nb (pid 24690) has died.
gjtorikian
Developer
Developer
 
Posts: 46
Joined: Wed May 12, 2010 4:35 pm

Top

Re: SDL port for Android SDK/NDK 1.6

Postby T-1000 » Mon Sep 12, 2011 10:31 pm

It's been a long travel for me, but at last my first app is published on the market (happy!)
Here's the link
http://market.android.com/details?id=ne ... ech.memory
and i hope you like it :)
The issue with the "external" events is present but i hope i can get rid of it soon.
Thanks again Pelya for all your support. I still want to make a donation to the project, so i hope you can include a Paypal donation widget somewhere in your page.
T-1000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Nov 12, 2010 12:10 pm

Re: SDL port for Android SDK/NDK 1.6

Postby T-1000 » Fri Sep 23, 2011 3:31 pm

I am having an issue trying to compile using the last GIT files. Is the actual version broken?

Code: Select all
Buildfile: /home/t-1000/Devel/Android/commandergenius/project/build.xml
    [setup] Android SDK Tools Revision 12
    [setup] Project Target: Android 3.1
    [setup] API level: 12
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup] [Fatal Error] :-1:-1: Premature end of file.

BUILD FAILED
/home/t-1000/Devel/Android/commandergenius/project/build.xml:65: org.xml.sax.SAXParseException; Premature end of file.
   at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:471)
   at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:518)
   at com.android.ant.SetupTask.checkManifest(SetupTask.java:307)
   at com.android.ant.SetupTask.execute(SetupTask.java:193)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:390)
   at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179)
   at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
   at org.apache.tools.ant.Main.runBuild(Main.java:786)
   at org.apache.tools.ant.Main.startAnt(Main.java:218)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException
   at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:476)
   at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:518)
   at com.android.ant.SetupTask.checkManifest(SetupTask.java:307)
   at com.android.ant.SetupTask.execute(SetupTask.java:193)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:390)
   at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179)
   at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
   at org.apache.tools.ant.Main.runBuild(Main.java:786)
   at org.apache.tools.ant.Main.startAnt(Main.java:218)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.xml.sax.SAXParseException; Premature end of file.
   at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:471)
   ... 17 more

Total time: 0 seconds
T-1000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Nov 12, 2010 12:10 pm

Re: SDL port for Android SDK/NDK 1.6

Postby T-1000 » Fri Sep 23, 2011 4:03 pm

nevermind... for some reason my AndroidManifestTemplate.xml was corrupted...
T-1000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Nov 12, 2010 12:10 pm

Re: SDL port for Android SDK/NDK 1.6

Postby akr » Tue Oct 11, 2011 11:07 am

Hello, I used the wrapper here for some time. In a new project I want to access resources from my c++ programm without the wrapper. Just with bare NDK. Any ideas how to do this?
akr
Developer
Developer
 
Posts: 38
Joined: Mon Nov 01, 2010 10:37 pm

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Tue Oct 11, 2011 5:12 pm

You'll need to use AssetManager from the Java code, you can retrieve it from your main activity with getAssets() method.
So you'll need to make Java calls from your C++ code. Here's an example how to call Java functions from C++ code, using JNI, it's quite cumbersome to resolve the methods, so in SDL I'm mostly using the opposite technique - I'm calling C functions from the Java code.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby qole » Wed Oct 12, 2011 1:53 am

Do you think this project could be used to bring an X Server to Android?

WebOS has an XSDL that might work: http://git.webos-internals.org/x11/xsdl/
qole
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Oct 12, 2011 1:43 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Wed Oct 12, 2011 9:51 am

I don't see any real benefit from porting X server to Android - if you're planning to port some GUI applications there's a QT port, unfortunately there's no GTK port around. WxWidgets port is pretty much possible, based on the QT port, however it's not done yet.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby akr » Wed Oct 12, 2011 4:16 pm

Thanks! Cant I just read from a apk file at a certain position if file is not compressed?

pelya wrote:You'll need to use AssetManager from the Java code, you can retrieve it from your main activity with getAssets() method.
So you'll need to make Java calls from your C++ code. Here's an example how to call Java functions from C++ code, using JNI, it's quite cumbersome to resolve the methods, so in SDL I'm mostly using the opposite technique - I'm calling C functions from the Java code.
akr
Developer
Developer
 
Posts: 38
Joined: Mon Nov 01, 2010 10:37 pm

Re: SDL port for Android SDK/NDK 1.6

Postby gjtorikian » Sat Nov 05, 2011 4:20 am

Quite surprised how quiet this space has become...anyway...

I can't seem to get the touchscreen working anymore. I'm not remapping any keys, and even if I remap it to ENTER or RETURN, I get no response from my app. Furthermore, accelerometer as arrow keys also seems to have stopped. I am on NDK r6b, and not sure what further information is needed.

Edit: I think it has something to do with setting the start-up menu to zero. When I set it to, say, 1500 ms, and define some things like accelerometer sensitivity and key definitions, everything seems to work just fine.

Ugh, also, I just screwed up my git commit in order to synch to your latest changes. Can you remove me as a collaborator? This is probably the third time I've done something stupid. Not sure how it actually pushed, when all I did was a commit.
gjtorikian
Developer
Developer
 
Posts: 46
Joined: Wed May 12, 2010 4:35 pm

Top
PreviousNext

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 7 guests