build+ci: Upgrade NDK dependency to crystax-10.2.1

As a result of the upgrade, sqlite3 module is no longer necessary, as it
is bundled with crystax NDK.

This commit also fixes compilation issue caused by jndn-util and
jndn-management dependency (both depend on "RELEASE" version of jndn-mock and
jndn-util library, causing compatibility problem).

Change-Id: Iabc70fdd899426a3e1b35c5f6f48202deaaf0043
diff --git a/.gitmodules b/.gitmodules
index 97b91e7..9d8d438 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,9 +2,6 @@
     path = app/src/main/jni/cryptopp
     url = http://github.com/cawka/cryptopp
     branch = android
-[submodule "app/src/main/jni/sqlite3"]
-    path = app/src/main/jni/sqlite3
-    url = https://github.com/cawka/sqlite3-android.git
 [submodule "app/src/main/jni/ndn-cxx"]
     path = app/src/main/jni/ndn-cxx
     url = ../ndn-cxx
diff --git a/.jenkins.d/10-get-ndk.sh b/.jenkins.d/10-get-ndk.sh
index 5729869..b6ed35d 100755
--- a/.jenkins.d/10-get-ndk.sh
+++ b/.jenkins.d/10-get-ndk.sh
@@ -3,7 +3,7 @@
 set -x
 
 URL=https://www.crystax.net/download/
-NDK=crystax-ndk-10.1.0
+NDK=crystax-ndk-10.2.1
 
 NDK_FILE="$NDK-linux-x86_64.tar.bz2"
 
diff --git a/.vagrant/Vagrantfile b/.vagrant/Vagrantfile
index 7115d2b..f2d8374 100644
--- a/.vagrant/Vagrantfile
+++ b/.vagrant/Vagrantfile
@@ -10,10 +10,9 @@
 sudo dpkg --add-architecture i386;
 sudo apt-get update -qq; sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386
 
-wget -q https://www.crystax.net/download/crystax-ndk-10.1.0-linux-x86_64.tar.bz2
-tar jxf crystax-ndk-10.1.0-linux-x86_64.tar.bz2
-rm crystax-ndk-10.1.0-linux-x86_64.tar.bz2
-find crystax-ndk-10.1.0 -name byteswap.h -exec sed -i -e 's/ swap/ bswap/g' {} \\;
+wget -q https://www.crystax.net/download/crystax-ndk-10.2.1-linux-x86_64.tar.bz2
+tar jxf crystax-ndk-10.2.1-linux-x86_64.tar.bz2
+rm crystax-ndk-10.2.1-linux-x86_64.tar.bz2
 
 wget -q http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
 tar zxf android-sdk_r24.0.2-linux.tgz
@@ -29,13 +28,13 @@
 echo "y" | android update sdk --filter platform-tools,build-tools-$BUILD_TOOLS_VERSION,android-$COMPILE_SDK_VERSION,extra-android-support,extra-android-m2repository,extra-google-m2repository --no-ui --all --force
 echo "y" | android update sdk --filter "android-19" --no-ui --all --force
 
-wget -q https://services.gradle.org/distributions/gradle-2.2.1-bin.zip
-unzip gradle-2.2.1-bin.zip
-rm gradle-2.2.1-bin.zip
-export PATH=$PATH:`pwd`/gradle-2.2.1/bin
+wget -q https://services.gradle.org/distributions/gradle-2.6-bin.zip
+unzip gradle-2.6.bin.zip
+rm gradle-2.6-bin.zip
+export PATH=$PATH:`pwd`/gradle-2.6/bin
 
 echo sdk.dir=`pwd`/android-sdk-linux > local.properties
-echo ndk.dir=`pwd`/crystax-ndk-10.1.0 >> local.properties
+echo ndk.dir=`pwd`/crystax-ndk-10.2.1 >> local.properties
 SCRIPT
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
diff --git a/README.md b/README.md
index 84c96f3..782b9b2 100644
--- a/README.md
+++ b/README.md
@@ -8,18 +8,13 @@
 To compile code, the following is necessary
 
 - Appropriate [Android SDK](http://developer.android.com/sdk/index.html)
-- [CrystalX Android NDK](https://www.crystax.net/en/download) version 10.1.0 or later
-
-If version 10.1.0 is used, then the following patch needs to be applied:
-
-    find crystax-ndk-10.1.0 -name byteswap.h -exec sed -i -e 's/ swap/ bswap/g' {} \;
+- [CrystalX Android NDK](https://www.crystax.net/en/download) version 10.2.1 or later
 
 Example script for Ubuntu 14.04 to get all dependencies, download SDK and NDK:
 
     sudo apt-get install -y build-essential git openjdk-7-jdk unzip
-    wget -q https://www.crystax.net/download/crystax-ndk-10.1.0-linux-x86_64.tar.bz2
-    tar jxf crystax-ndk-10.1.0-linux-x86_64.tar.bz2
-    find crystax-ndk-10.1.0 -name byteswap.h -exec sed -i -e 's/ swap/ bswap/g' {} \;
+    wget -q https://www.crystax.net/download/crystax-ndk-10.2.1-linux-x86_64.tar.bz2
+    tar jxf crystax-ndk-10.2.1-linux-x86_64.tar.bz2
 
     wget -q http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
     tar zxf android-sdk_r24.0.2-linux.tgz
@@ -27,8 +22,8 @@
 
     echo y |  ./android-sdk-linux/tools/android update sdk -a -u -t "android-19"
 
-    wget -q https://services.gradle.org/distributions/gradle-2.2.1-bin.zip
-    unzip gradle-2.2.1-bin.zip
+    wget -q https://services.gradle.org/distributions/gradle-2.6-bin.zip
+    unzip gradle-2.6-bin.zip
 
     SDK_TOOLS_VERSION=24.0.2
     BUILD_TOOLS_VERSION=21.1.2
@@ -48,10 +43,10 @@
 
     git clone --recursive http://gerrit.named-data.net/NFD-android
     echo sdk.dir=`pwd`/android-sdk-linux > NFD-android/local.properties
-    echo ndk.dir=`pwd`/crystax-ndk-10.1.0 >> NFD-android/local.properties
+    echo ndk.dir=`pwd`/crystax-ndk-10.2.1 >> NFD-android/local.properties
     cd NFD-android
 
-    ../gradle/gradle-2.2.1/bin/gradle assembleRelease
+    ../gradle/gradle-2.6/bin/gradle assembleRelease
 
 
 ## Setting up environment using Vagrant
diff --git a/app/build.gradle b/app/build.gradle
index 2a2b70c..c55ce1e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -136,8 +136,14 @@
     compile 'net.named-data:jndn:0.4'
     compile 'net.named-data.jndn-xx:jndn-xx-util:0.0.1'
 
-    compile 'com.intel.jndn.utils:jndn-utils:0.9.7'
-    compile 'com.intel.jndn.management:jndn-management:0.9.7'
+    compile('com.intel.jndn.utils:jndn-utils:0.9.7') {
+      force = true
+      exclude group: 'com.intel.jndn.mock'
+    }
+    compile('com.intel.jndn.management:jndn-management:0.9.7') {
+      force = true
+      exclude group: 'com.intel.jndn.jndn-utils'
+    }
     compile 'com.google.protobuf:protobuf-java:2.6.1'
 
     compile 'joda-time:joda-time:2.7'
diff --git a/app/src/main/jni/ndn-cxx.mk b/app/src/main/jni/ndn-cxx.mk
index 0419abc..3f3fcd6 100644
--- a/app/src/main/jni/ndn-cxx.mk
+++ b/app/src/main/jni/ndn-cxx.mk
@@ -5,7 +5,7 @@
 LOCAL_MODULE := ndn-cxx
 NDN_CXX_BOOST_LIBS = system filesystem date_time iostreams program_options chrono random
 LOCAL_SHARED_LIBRARIES := cryptopp $(addsuffix _shared,$(addprefix boost_,$(NDN_CXX_BOOST_LIBS)))
-LOCAL_STATIC_LIBRARIES := sqlite3 boost_regex_static
+LOCAL_STATIC_LIBRARIES := sqlite3_static boost_regex_static
 NDN_CXX_SRC_FILES := \
     data.cpp \
     encoding/block.cpp \
@@ -91,7 +91,7 @@
 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ndn-cxx-android
 include $(BUILD_SHARED_LIBRARY)
 
-include $(LOCAL_PATH_SAVED)/sqlite3/Android.mk
 include $(LOCAL_PATH_SAVED)/cryptopp/Android.mk
 
 $(call import-module,boost/1.57.0)
+$(call import-module,sqlite/3)
diff --git a/app/src/main/jni/sqlite3 b/app/src/main/jni/sqlite3
deleted file mode 160000
index b2b9ab5..0000000
--- a/app/src/main/jni/sqlite3
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b2b9ab529987de81585ce6bf7bcfab91917f37af