Skip to content

cybertronhac/CLIPS4Android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLIPS4Android

CLIPS4Android is a project created to adapt CLIPS to Android (I know, too obvious).

The project is organized as follows:

ClipsAndroid
It is an Android library which is intended to be used by other Android applications. To compile the eclipse project, it is necessary to compile CLIPS for Android first (see Compiling CLIPS for Android.).
Examples

It contains different Android applications which use ClipsAndroid:

Compiling CLIPS for Android

Follow the following steps to compile CLIPS for Android:

  1. Install the NDK
  2. Go to the jni folder
  3. Run ndk-build [*]
[*]Providing you have added it to your PATH.

Debugging CLIPS on Android

The cleanest way to show messages from a native library in Android is by simply redirecting its output (see Redirecting stdout). However, this method has not always work for me (sorry, I don't know the cause). That's why I forced CLIPS to show all its messages using Logcat (see Logcat from native code).

Redirecting stdout

CLIPS may throw system exits. As a result, the Android process using CLIPS can unexpectedly crash without giving any useful information. To show CLIPS' original error messages, redirect NDK's standard output to LogCat using the following commands:

$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start

Logcat from native code

Sometimes the previous property does not work (I don't know why yet). Since messages can be directly logged on Logcat, we replaced the printf's with these Logcat's logs in the issue 2 .

To that end, we have done an utility macro. Common usage:

#include "logcat.h"

...

aprintf("This is an standard message\n");

License

CLIPS's source files remain licensed in the public domain.

The rest of the parts of this project will be licensed also as public domain unless the contrary is stated.

Acknowledgements

The development of the ClipsAndroid library was possible thanks to the work done in the CLIPSJNI project.

Besides, this project is supported or has been supported by the THOFU R&D project (project grant CEN-20101019). THOFU was funded by the Spanish Centro para el Desarrollo Tecnológico Industrial (CDTI) and supported by the Spanish Ministerio de Economía y Competitividad.

About

CLIPS for Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 97.6%
  • Java 1.3%
  • CLIPS 0.5%
  • C++ 0.5%
  • Objective-C 0.1%
  • Makefile 0.0%