diff --git a/YAPDroid/YAPDroid.md b/YAPDroid/YAPDroid.md
deleted file mode 100644
index 51bd6dd88..000000000
--- a/YAPDroid/YAPDroid.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-## YAPDroid
-
-This file documents the YAPDroid application. This app was developed in order to
-test the YAP-Android interface. It provides a simple REPL with a query window and a text
-viewer.
-
-### Design
-
-The YAP interface to Android is based on the SWIG interface generator. SWIG exports the YAP
-C++ classes as Java classes. In practice there exist two worlds, the native application
-and the Java application:
-
- - YAP runs in Android as a native application in a Linux
-environment. Android does not support glibc. Instead, Android libraries are provided by the Android NDK, and
-are somewhat limited, i.e., the NDK misses in-memory streams and a `glob`
-predicate. Moreover, read-only data is kept in a zipped archive that is made to appear as
-a directory, `~/assets`
-
- - SWIG generates the glue code: JNI classes that act as Java classes. Callbacks are possible.
-
- - Java code operates as usual.
-
-### Compiling YAPDroid
-
-The current version was compiled using the recent Android Studio `cmake` support. Android Studio uses
-`gradle` as the build system. `gradle` orchestrates compilation of all Java code. External code is delegated
-to `cmake` or the Android NDK own builder. The idea fits nicely with YAP; unfortunately, the process currently
-crashes in middle.
-
-To install, navigate through these steps:
-1. Obtain `gmp` for Android. YAP has used the [Rupan repo](https://github.com/Rupan/gmp); place the repo next to
-the yap-6.3 top directory.
-
-2. Install [swig](www/swig.org)
-
-2. Obtain Android Studio. This work used Android Studio 2.2 Beta 3. The IDE includes most everything else you need: the ADK, the NDK, `cmake`, the `ninja` build system, and the debugger.
-
-3. Set YAPDroid as your directory.
-
-4. Adapt the `build.gradle` files to your configuration.
- + It may be a good idea to first generate an empty configuration and compare.
- + In the `lib` directory, please verify wich targets you are generating for.
-
-4. Build the system, either from the GUI or from a terminal, say as:
-~~~~~
-./gradlew assembleDebug
-~~~~~
-or
-~~~~~
-./gradlew :lib:assembleDebug
-~~~~~
-You should see `cmake` being executed, and after some time `gradle` crash.
-
-5. To actually install the binaries, use:
-~~~~~
-cd lib/build/intermediates/cmake/debug/json/armeabi-v7a
-ninja install
-~~~~~
-6. Comment the four lines in `lib/build.gradle` to avoid crashing in the `cmake` task.
-
-7. use the GUI commands to compile the app or set your directory bak to
-the YAPDroid top-directory and call `gradle`.
-
-Enjoy!
-
-### Limitations and TODO
-
-- improve error handling.
-- support `/assets`: the code is written but not tested yet.
-- network access
-- sqlite testing and support
diff --git a/YAPDroid/app/build.gradle b/YAPDroid/app/build.gradle
deleted file mode 100644
index 8d9a4b9a3..000000000
--- a/YAPDroid/app/build.gradle
+++ /dev/null
@@ -1,37 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 23
- buildToolsVersion "23.0.3"
- defaultConfig {
- applicationId "pt.up.yap.app"
- minSdkVersion 19
- targetSdkVersion 23
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-
-}
-
-
-project.gradle.taskGraph.whenReady {
- connectedDebugAndroidTest {
- ignoreFailures = true
- }
-}
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:23.4.0'
- testCompile 'junit:junit:4.12'
- androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
- androidTestCompile 'com.android.support.test:runner:0.5'
- androidTestCompile 'com.android.support:support-annotations:23.4.0'
- compile 'com.google.android.gms:play-services-appindexing:8.4.0'
-}
diff --git a/YAPDroid/app/src/main/AndroidManifest.xml b/YAPDroid/app/src/main/AndroidManifest.xml
deleted file mode 100755
index 377074404..000000000
--- a/YAPDroid/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/YAPDroid/app/src/main/java/pt/up/yap/app/CreateFiles.java b/YAPDroid/app/src/main/java/pt/up/yap/app/CreateFiles.java
deleted file mode 100644
index b87215a9a..000000000
--- a/YAPDroid/app/src/main/java/pt/up/yap/app/CreateFiles.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package pt.up.yap.app;
-
-import android.content.Context;
-import android.content.res.AssetManager;
-
-import android.support.v4.content.res.ResourcesCompat;
-import android.util.Log;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-
-/**
- * Created by vsc on 30/05/16.
- */
-
-public class CreateFiles {
-
-
-
- public static void setupfiles(Context context, AssetManager assets){
- try {
-
- context.getExternalFilesDir("Yap").mkdirs();
- context.getExternalFilesDir("Yap/pl").mkdirs();
- context.getExternalFilesDir("Yap/os").mkdirs();
- String list[] = {};
- list= assets.list("Yap");
- for (int i = 0; i < list.length; i++) {
- copy(context, "Yap/"+ list[i]);
- }
- list = null;
- list= assets.list("Yap/pl");
- for (int i = 0; i < list.length; i++) {
- copy(context, "Yap/pl/"+ list[i]);
- }
- list =null;
- list= assets.list("Yap/os");
- for (int i = 0; i < list.length; i++) {
- copy(context, "Yap/os/"+ list[i]);
- }
- Log.d("CreateFiles", context.getFilesDir().getAbsolutePath());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private static void copy(Context context, String originalName) {
- try {
- if (originalName.contains(".")) {
- File outFile;
-
- outFile = new File(context.getExternalFilesDir(null), originalName );
-
- InputStream in = context.getAssets().open(originalName);
- BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFile));
-
-
- byte data[] = new byte[1024];
- int count;
-
- while ((count = in.read(data)) != -1) {
- out.write(data, 0, count);
- }
-
- out.flush();
- out.close();
- in.close();
-
- in = null;
- out = null;
- //Log.d("Copied: ", originalName + " to " + destinationName);
- //System.out.println("Copied: "+ originalName + " to " + destinationName);
- //System.out.println();
- }
- }catch(IOException e){
- e.printStackTrace();
- }
-
- }
-}
diff --git a/YAPDroid/app/src/main/java/pt/up/yap/app/YAPDroid.java b/YAPDroid/app/src/main/java/pt/up/yap/app/YAPDroid.java
deleted file mode 100755
index 073053273..000000000
--- a/YAPDroid/app/src/main/java/pt/up/yap/app/YAPDroid.java
+++ /dev/null
@@ -1,330 +0,0 @@
-package pt.up.yap.app;
-/****
- * using sqlite
- * For example,the following:
- *
- * import android.database.sqlite.SQLiteDatabase;
- *
- * should be replaced with:
- *
- * import org.sqlite.database.sqlite.SQLiteDatabase;
- *
- * As well as replacing all uses of the classes in the android.database.sqlite.* namespace, the application must also be sure to use the following two:
- *
- * org.sqlite.database.SQLException
- * org.sqlite.database.DatabaseErrorHandler
- *
- * instead of:
- *
- * android.database.SQLException
- * android.database.DatabaseErrorHandler
- *
- * Aside from namespace changes, there are other differences from the stock Android interface that applications need to be aware of:
- *
- * The SQLiteStatement.simpleQueryForBlobFileDescriptor() API is not available. The collation sequence "UNICODE" is not available. The collation sequence "LOCALIZED", which normally changes with the system's current locale, is always equivalent to SQLite's built in collation BINARY.
- ****/
-
-import android.content.Context;
-import android.app.Activity;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.AssetManager;
-import android.net.Uri;
-import android.os.Bundle;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import android.text.method.ScrollingMovementMethod;
-import android.util.Log;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.ScrollView;
-import android.widget.TextView;
-
-import com.google.android.gms.appindexing.Action;
-import com.google.android.gms.appindexing.AppIndex;
-import com.google.android.gms.appindexing.Thing;
-import com.google.android.gms.common.api.GoogleApiClient;
-
-import org.sqlite.database.DatabaseErrorHandler;
-import org.sqlite.database.sqlite.SQLiteDatabase;
-
-import pt.up.yap.lib.*;
-
-class DoNotDeleteErrorHandler implements DatabaseErrorHandler {
- private static final String TAG = "DoNotDeleteErrorHandler";
-
- public void onCorruption(SQLiteDatabase dbObj) {
- Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath());
- }
-}
-
-public class YAPDroid extends Activity {
-
- private static final String TAG = "YAPDroid";
-
- TextView outputText = null;
- ScrollView scroller = null;
- YAPEngine eng = null;
- EditText text;
- String str;
- String buf;
- YAPQuery q;
- Boolean running = false, compute = true;
- int i = 1;
- YAPListTerm vs0;
- private AssetManager mgr;
- /**
- * ATTENTION: This was auto-generated to implement the App Indexing API.
- * See https://g.co/AppIndexing/AndroidStudio for more information.
- */
- private GoogleApiClient client;
-
- // private static native void load(AssetManager mgr);
-
-
- void runQuery(String str, Boolean more) {
- try {
- // check if at initial query
- if (running) {
- if (q != null) q.close();
- }
-
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "query " + str);
- }
-
- q = eng.query(str);
- // get the uninstantiated query variables.
- vs0 = q.namedVars();
- running = true;
- // start computing
- compute = true;
-
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "onQueryButtonClick called");
- }
-
- Boolean rc = true;
-
- text.setText("?- ");
- if (vs0.nil()) {
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "q0=\n");
- }
- if (compute && (rc = q.next())) {
- outputText.append("yes\n");
- running = compute = more;
- } else {
- outputText.append("no\n");
- running = false;
- compute = false;
- }
- } else {
- // if (BuildConfig.DEBUG) {
- // Log.i(TAG, "q1= " + vs0.text() + "\n");
- // }
- while (compute && (rc = q.next())) {
- YAPListTerm vs = q.namedVars();
- while (!vs.nil()) {
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "q= " + vs.text() + "\n");
- }
- YAPTerm eq = vs.car();
- //outputText.append(Integr.toString(i) + ": " + eq.text() );
- outputText.append(Integer.toString(i));
- outputText.append(":\t" + eq.getArg(1).text() + " = " + eq.getArg(2).text() + "\n");
- vs = vs.cdr();
- }
- compute = more;
- }
- }
- if (!rc) {
- outputText.append("no\n");
- if (q != null)
- q.close();
- q = null;
- compute = false;
- running = false;
- }
- } catch (Exception e) {
- outputText.append("Exception thrown :" + e);
- if (q != null)
- q.close();
- compute = true;
- running = false;
- }
- }
-
- /**
- * Called when the activity is first created.
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- String s = null;
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- try {
- PackageManager
- m = getPackageManager();
- s = getPackageName();
- PackageInfo p = m.getPackageInfo(s, 0);
- //s = p.applicationInfo.dataDir;
- mgr = this.getAssets();
-
- /** static constructor */
- // follow this order carefully.
- System.loadLibrary("gmp");
- System.loadLibrary("Yap");
- System.loadLibrary("Yapsqlite3");
- System.loadLibrary("Yap++");
- System.loadLibrary("YAPDroid");
- CreateFiles.setupfiles(this, mgr);
-
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Couldn't find package information in PackageManager", e);
- }
- Log.i(TAG, "mgr=" + mgr);
-
- text = (EditText) findViewById(R.id.EditText01);
- outputText = (TextView) findViewById(R.id.OutputText);
- outputText.setText("Application " + s + "\nPress 'First' or 'All' to query...\n");
- outputText.setMovementMethod(new ScrollingMovementMethod());
- scroller = (ScrollView) findViewById(R.id.Scroller);
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "window making done");
- }
- eng = new YAPEngine(null, this.getExternalFilesDir("/Yap/pl/boot.yap").getAbsolutePath());
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "engine done");
- }
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "onClearButtonClick called");
- }
- JavaCallback callback = new JavaCallback(outputText);
- // set the Java Callback
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "before setting callback");
- }
- eng.setYAPCallback(callback);
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "callback done");
- }
- // ATTENTION: This was auto-generated to implement the App Indexing API.
- // See https://g.co/AppIndexing/AndroidStudio for more information.
- client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
- }
-
- public void onClearButtonClick(View view) {
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "onClearButtonClick called");
- }
- // Ensure scroll to end of text
- scroller.post(new Runnable() {
- public void run() {
- scroller.fullScroll(ScrollView.FOCUS_DOWN);
- if (running) {
- if (q != null)
- q.close();
- q = null;
- }
- running = false;
- text.setText("");
- }
- });
- }
-
- public void onFirstButtonClick(View view) {
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "onQueryButtonClick called");
- }
- // Ensure scroll to end of text
- scroller.post(new Runnable() {
- public void run() {
- scroller.fullScroll(ScrollView.FOCUS_DOWN);
- str = text.getText().toString();
- //outputText.append("?- " + str+"\n\n");
- Log.i(TAG, "onQueryAnyButtonClick " + str + "\n");
- runQuery(str, false);
- scroller.fullScroll(ScrollView.FOCUS_DOWN);
- }
- });
- }
-
- public void onAllButtonClick(View view) {
- if (BuildConfig.DEBUG) {
- Log.i(TAG, "onQueryButtonClick called");
- }
- // Ensure scroll to end of text
- scroller.post(new Runnable() {
- public void run() {
- str = text.getText().toString();
- scroller.fullScroll(ScrollView.FOCUS_DOWN);
- outputText.append("?- " + str + "\n\n");
- Log.i(TAG, "onAllButtonClick " + str + "\n");
- runQuery(str, true);
- scroller.fullScroll(ScrollView.FOCUS_DOWN);
- }
- });
- }
-
- /**
- * ATTENTION: This was auto-generated to implement the App Indexing API.
- * See https://g.co/AppIndexing/AndroidStudio for more information.
- */
- public Action getIndexApiAction() {
- Thing object = new Thing.Builder()
- .setName("YAPDroid Page") // TODO: Define a title for the content shown.
- // TODO: Make sure this auto-generated URL is correct.
- .setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
- .build();
- return new Action.Builder(Action.TYPE_VIEW)
- .setObject(object)
- .setActionStatus(Action.STATUS_TYPE_COMPLETED)
- .build();
- }
-
- @Override
- public void onStart() {
- super.onStart();
-
- // ATTENTION: This was auto-generated to implement the App Indexing API.
- // See https://g.co/AppIndexing/AndroidStudio for more information.
- client.connect();
- AppIndex.AppIndexApi.start(client, getIndexApiAction());
- }
-
- @Override
- public void onStop() {
- super.onStop();
-
- // ATTENTION: This was auto-generated to implement the App Indexing API.
- // See https://g.co/AppIndexing/AndroidStudio for more information.
- AppIndex.AppIndexApi.end(client, getIndexApiAction());
- client.disconnect();
- }
-}
-
-class JavaCallback extends YAPCallback {
- private static final String TAG = "JavaCallback";
- TextView output;
-
- public JavaCallback(TextView outputText) {
- super();
- output = outputText;
- Log.i(TAG, "java callback init");
- }
-
- public void run(String s) {
- Log.i(TAG, "java callback ");
- output.append(s);
- }
-
-}
diff --git a/YAPDroid/app/src/main/res/layout/main.xml b/YAPDroid/app/src/main/res/layout/main.xml
deleted file mode 100755
index c981bcd4e..000000000
--- a/YAPDroid/app/src/main/res/layout/main.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/YAPDroid/build.gradle b/YAPDroid/build.gradle
deleted file mode 100644
index d9a509ec5..000000000
--- a/YAPDroid/build.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.2.0-alpha7'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/YAPDroid/lib/build.gradle b/YAPDroid/lib/build.gradle
deleted file mode 100644
index a853f931b..000000000
--- a/YAPDroid/lib/build.gradle
+++ /dev/null
@@ -1,42 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 23
- buildToolsVersion "23.0.3"
- defaultConfig {
- applicationId "pt.up.yap.app"
- minSdkVersion 19
- targetSdkVersion 23
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- cmake {
- // cFlags "-DTEST_C_FLAG1" "-DTEST_C_FLAG2"
- // cppFlags "-DTEST_CPP_FLAG2" "-DTEST_CPP_FLAG2"
- abiFilters "armeabi-v7a", "x86"
- }
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-// externalNativeBuild {
-// cmake {
-// path '../../CMakeLists.txt'
-// }
-// }
-
-
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:23.4.0'
- testCompile 'junit:junit:4.12'
- androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
- androidTestCompile 'com.android.support.test:runner:0.5'
- androidTestCompile 'com.android.support:support-annotations:23.4.0'
-}
diff --git a/YAPDroid/settings.gradle b/YAPDroid/settings.gradle
deleted file mode 100644
index 3cbe24935..000000000
--- a/YAPDroid/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app', ':lib'