Search code examples
androidc++android-ndkandroid-sdcard

Free Fuzzy Logic Library, can't parse a file on android


I am developing an application for android/iOS/windows using c++ code for the core logic. The application uses the free fuzzy logic library and it works perfectly for windows mobile, iOS and on my local Ubuntu machine, but it doesn't quite work under android.

The application reads a .fcl file from the sd card and then parses it using the free fuzzy logic library parser. The problem is, that the parser gets stuck at random stages of parsing.

Some notes to my project settings:

  • I enabled the Android read/write permissions for the sdcard in the manifest.xml.

  • The code I am trying to run is the basic example from the free fuzzy logic library website.

  • I am using the stlport_static library for stl support and the -frtti compiler flag.

My question is: Am I missing something android specific, like file encoding or some permissions I didn't set?

Some notes I thought about:

  • File compression should not be an issues, because, to my knowledge, files on the SD card are not compressed and I can parse the file partially.

  • Using other fuzzy logic libraries is out of the option, because I can't use GPL licenced libraries. The only other library I found didn't hat a manual / how to and couldn't parse the fcl standard.

  • The free fuzzy logic library uses a lot of wchar_t's whitch could be an issue.

Thank you for your time and hopefully for some help ;)


Solution

  • Currently Android doesn't support the wchar_t type. Well you can use it, but the results will not be the same as on any other operating system.

    By changing all the wchar_t and wstring types in the free fuzzy logic library to their corresponding char and string types I was able to make the parser work. Well sort of, there are still some sleight inconsistencies, but nothing i can't handle ;).

    Conclusion: Don't use wide characters in android c++ Programs.