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 App Framework
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
I wrote a simple framework for developing apps using SDL. Theoretically it could be used for mobile or desktop, but my intent was for mobile devices. My next goal is to write a build script in python to compile it for any target.

Here is the source(If you have a better name for it I'd welcome it). https://github.com/ruler501/AppFramework
goxl


Joined: 23 Jan 2014
Posts: 17
this is cool~~~~~~~~~~~~~~
Naith


Joined: 03 Jul 2014
Posts: 158
I've successfully created the project (with the ndk-build script in Windows) but when I execute the program in an emulator, or on a real device, an error message comes up on the screen saying "App has stopped". I can't seem to solve this issue. Any ideas on what can cause this problem?
SDL App Framework
Pallav Nawani


Joined: 19 May 2011
Posts: 122
Location: Dehradun, India
check the logcat to see the problem.
On a console, run adb logcat. Then execute program. The logcat will likely contain the reason your program was stopped.

Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter:  http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768



On Sat, Sep 6, 2014 at 8:29 PM, Naith wrote:
Quote:
I've successfully created the project (with the ndk-build script in Windows) but when I execute the program in an emulator, or on a real device, an error message comes up on the screen saying "App has stopped". I can't seem to solve this issue. Any ideas on what can cause this problem?


_______________________________________________
SDL mailing list

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

Naith


Joined: 03 Jul 2014
Posts: 158
Thanks for your answer. I check logcat inside Eclipse and got these error messages: http://tinypic.com/view.php?pic=15ydr9h&s=8#.VAwpXxaC_ng

And second try (after rebuild with ndk-build script): http://tinypic.com/view.php?pic=elsmf&s=8#.VAwtSxaC_ng

I have no idea what any of those mean.
SDL App Framework
Pallav Nawani


Joined: 19 May 2011
Posts: 122
Location: Dehradun, India
Hi,


In the second image you linked to, at 5th line from the bottom, you can see the cause of crash being UnsatisfiedLinkError. What this usually means is that you are trying to load a native library that doesn't exist or you didn't compile in. If you open SDLActivity.Java in eclipse and go to around line 49 (the line number is visible in the error log you showed me), you should see something like:



// Load the .so
    static {
        System.loadLibrary("SDL2");
        System.loadLibrary("SDL2_image");
        //System.loadLibrary("SDL2_mixer");
        //System.loadLibrary("SDL2_net");
        //System.loadLibrary("SDL2_ttf");
        System.loadLibrary("main");
    }


 System.loadLibrary("SDL2"); for example, loads the SDL libary dynamically.  Check for the libraries you are not using, but you are trying to load, and comment those lines. In particular, try commenting the lines System.loadLibrary("reloc_library");  and System.loadLibrary("signal"); if they exist.

Hope this helps.




Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter:  http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768


On Sun, Sep 7, 2014 at 3:33 PM, Naith wrote:
Quote:
Thanks for your answer. I check logcat inside Eclipse and got these error messages: http://tinypic.com/view.php?pic=15ydr9h&s=8#.VAwpXxaC_ng

And second try (after rebuild with ndk-build script): http://tinypic.com/view.php?pic=elsmf&s=8#.VAwtSxaC_ng

I have no idea what any of those mean.


_______________________________________________
SDL mailing list

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

Naith


Joined: 03 Jul 2014
Posts: 158
Thanks for the answer.

I edited the SDLActivity.java and commented in SDL_image and such so I can use the external libraries but I still get the following errors: http://tinypic.com/view.php?pic=2lx7ayv&s=8

I really don't get it and it makes me really frustrated. A lot of people are making android apps with SDL (as far as I know) and there must be something that I'm doing wrong. Confused
SDL App Framework
Pallav Nawani


Joined: 19 May 2011
Posts: 122
Location: Dehradun, India
It is showing the same error as before. Why, I've no idea. This probably a configuration issue, one you will have to debug at your end, I am afraid.

Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter:  http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768


On Mon, Sep 8, 2014 at 4:54 PM, Naith wrote:
Quote:
Thanks for the answer.

I edited the SDLActivity.java and commented in SDL_image and such so I can use the external libraries but I still get the following errors: http://tinypic.com/view.php?pic=2lx7ayv&s=8

I really don't get it and it makes me really frustrated. A lot of people are making android apps with SDL (as far as I know) and there must be something that I'm doing wrong.


_______________________________________________
SDL mailing list

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

Naith


Joined: 03 Jul 2014
Posts: 158
Thanks anyway. Smile
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
Try running these commands in an empty directory and see if that works

git clone https://github.com/ruler501/AppFramework
cd AppFramework/android
cp ../src/* jni/src
adroid update project --path ./
cd jni/src && ndk-build -j8 NDK_DEBUG=1
ant debug install

If that doesn't work it means the error is on my side.
Naith


Joined: 03 Jul 2014
Posts: 158
Should I execute the commands in a commando prompt (I'm using Windows-OS)?

ruler501 wrote:

cp ../src/* jni/src
adroid update project --path ./
cd jni/src && ndk-build -j8 NDK_DEBUG=1
ant debug install


These commands doesn't work.
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
Yes you do execute them in the command prompt

If you have the build environment setup correctly for android(ant and android on the system path) those commands should execute just fine
Naith


Joined: 03 Jul 2014
Posts: 158
I've indeed added the Android Development Tools- and Android Development Kit to the system path but I'm not sure if that's all I have to do. http://tinypic.com/view.php?pic=11ujfj9&s=8#.VBXqvBaC_ng

Is the "cp"-command a command prompt command or an android specific command?
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
cp is a standard windows command prompt command
Naith


Joined: 03 Jul 2014
Posts: 158
It turns out that the cp command is a UNIX command but I just copied the files from the first directory to the other.

"adroid update project --path ./ " doesn't work either. Did I do the system path correctly?
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
Hm it works fine for me to use cp

Replace ./ with the path to the Android directory.
Naith


Joined: 03 Jul 2014
Posts: 158
Sorry, still doesn't work. I really doubt it's something wrong with your framework and that the error / problem is with my computer. Thanks for your time.