SFML community forums

Help => General => Topic started by: Crynux on February 15, 2015, 05:02:35 am

Title: Porting existing SFML code to work with Android [SOLVED]
Post by: Crynux on February 15, 2015, 05:02:35 am
Hello all,

Over the past little while I've been developing an application that uses SFML for graphics and audio on Windows. Recently, it has been decided to try to port this same application to Android.

I've downloaded, compiled and ran the Android SFML example, along with the standard NDK examples; they run fine.

However, I've run into a few problems, I hope someone can help me or point me in the right direction:

I've spent a few days working on this, and haven't found a solution yet. Any help or guidance would be greatly appreciated. I'm rather new to Android development, and have only been working with SFML for a few months; hopefully I'm not missing something simple!

EDIT: I should mention that my SFML code compiles and works fine on Windows and Linux.

Thank you in advance,
-Crynux

PS: If this post is not in the right area, I apologize.


SOLUTION:
After 6 hours of fiddling around with my code... I've found the problem. In the AndroidManifest.xml, you have to make sure android:hasCode="true". By default in the SFML Android example, it seems to be "false".

Once that is set, you can access custom Java classes using JNI; however, I won't go into detail regarding how I did that.