Minor fixes to the build android ndk guide script

* Aligns both sh script and md file
* Change default branch to main as 'latest' release will change every 3 month
* Clones github repos instead of mlplatform repos

Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
Change-Id: I4bed6c4c231b5f3bab0abf92b0febf825ddb4ce7
diff --git a/BuildGuideAndroidNDK.md b/BuildGuideAndroidNDK.md
index b42e7e8..a133956 100644
--- a/BuildGuideAndroidNDK.md
+++ b/BuildGuideAndroidNDK.md
@@ -21,9 +21,12 @@
 For ease of use there is a shell script version of this guide located in the scripts directory called [build_android_ndk_guide.sh](scripts/build_android_ndk_guide.sh). 
 Run the script with a -h flag to see the command line parameters.
 
+The shell script version of this guide (build_android_ndk_guide.sh) also provides user the option to use the Arm NN and ComputeLibrary available in your BASE_DIR, instead of downloading a new version.
+BASE_DIR is path to the script file, which is armnn/scripts/.
+
 ## Initial Setup
 
-First, we need to specify the Android version and the directories you want to build armnn in and to install some applications required to build Arm NN and its dependencies.
+First, we need to specify the Android version and the directories you want to build Arm NN in and to install some applications required to build Arm NN and its dependencies.
 
 ```bash
 export ANDROID_API=30
@@ -126,7 +129,7 @@
 cmake .. \
     -DCMAKE_ANDROID_NDK=$NDK_DIR \
     -DCMAKE_SYSTEM_NAME=Android \
-    -DCMAKE_SYSTEM_VERSION=27 \
+    -DCMAKE_SYSTEM_VERSION=$ANDROID_API \
     -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
     -DCMAKE_CXX_FLAGS=--std=c++14 \
     -DFLATBUFFERS_BUILD_FLATC=OFF \
@@ -162,28 +165,34 @@
 ## Get And Build TFLite
 This optional step is only required if you intend to build the TFLite delegate or parser for Arm NN. 
 
-First clone tensorflow:
+First clone Tensorflow manually and check out the version Arm NN was tested with:
 ```bash
 cd $WORKING_DIR
 git clone https://github.com/tensorflow/tensorflow.git
 cd tensorflow
 git fetch && git checkout "6f692f73cb2043b4a0b0446539cd8c15b3dd9220"
 ```
-Arm NN provides a script that downloads the version of Tensorflow that Arm NN was tested with:
+Or use the script that Arm NN provides:
 ```bash
 git fetch && git checkout $(../armnn/scripts/get_tensorflow.sh -p)
 ```
-Next build Tensorflow Lite:
+Next, set variable TFLITE_ROOT_DIR and build Tensorflow Lite:
 ```bash
+export TFLITE_ROOT_DIR=$WORKING_DIR/tensorflow/tensorflow/lite
 cd $WORKING_DIR
 mkdir -p tflite-out/android
 cd tflite-out/android
 
-CMARGS="-DCMAKE_TOOLCHAIN_FILE=$NDK_DIR/build/cmake/android.toolchain.cmake \
+CMARGS="-DTFLITE_ENABLE_XNNPACK=OFF \
+        -DFLATBUFFERS_BUILD_FLATC=OFF \
+        -DBUILD_SHARED_LIBS=OFF \
+        -DBUILD_TESTING=OFF"
+
+CMARGS="$CMARGS -DCMAKE_TOOLCHAIN_FILE=$NDK_DIR/build/cmake/android.toolchain.cmake \
     -DANDROID_ABI=arm64-v8a \
     -DANDROID_PLATFORM=$ANDROID_API"
 
-cmake $CMARGS $WORKING_DIR/tensorflow/tensorflow/lite
+cmake $CMARGS $TFLITE_ROOT_DIR
 
 cd $WORKING_DIR
 cmake --build tflite-out/android -j 16
@@ -329,7 +338,11 @@
   Currently adb version we have used for testing is 1.0.41.
 ```bash
 adb push libarmnn.so /data/local/tmp/
-    adb push libtimelineDecoder.so /data/local/tmp/
+adb push libtimelineDecoder.so /data/local/tmp/
+adb push libtimelineDecoderJson.so /data/local/tmp/
+adb push GatordMock /data/local/tmp/
+adb push libarmnnBasePipeServer.so /data/local/tmp/
+adb push libarmnnTestUtils.so /data/local/tmp/
 adb push UnitTests /data/local/tmp/
 adb push $NDK_DIR/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so /data/local/tmp/
 ```
diff --git a/scripts/build_android_ndk_guide.sh b/scripts/build_android_ndk_guide.sh
index 7f76218..66ba282 100755
--- a/scripts/build_android_ndk_guide.sh
+++ b/scripts/build_android_ndk_guide.sh
@@ -13,8 +13,8 @@
   echo "Options:"
   echo "    -l Use this copy of Arm NN and ComputeLibrary instead of cloning new copies"
   echo "       <1 or 0> defaults to 1"
-  echo "    -a Override Arm NN branch (defaults to latest release branches/armnn_23_02)"
-  echo "    -b Override ACL branch (defaults to latest release v23.02)"
+  echo "    -a Override Arm NN branch (defaults to main branch). For example to use 23.02 release use branch name branches/armnn_23_02"
+  echo "    -b Override ACL branch (defaults to main branch). For example to use 23.02 release use tag v23.02"
   echo "    -A Android API level defaults to 30"
   echo "    -n Neon (CpuAcc backend) enabled <1 or 0> defaults to 1"
   echo "    -g CL (GpuAcc backend) enabled <1 or 0> defaults to 1"
@@ -42,8 +42,8 @@
 
 # Set variables and working directory
 CREATE_LINKS=1
-ARMNN_BRANCH=branches/armnn_23_02
-ACL_BRANCH=v23.02
+ARMNN_BRANCH=main
+ACL_BRANCH=main
 ACL_NEON=1
 ACL_CL=1
 REFERENCE=1
@@ -164,17 +164,22 @@
     cd $WORKING_DIR
 
     if [[ ! -d armnn ]]; then
-        if [[ $CREATE_LINKS = 1  && -d $BASE_DIR/../../armnn ]]; then
-            echo "+++ Linking Arm NN"
-            ln -s $BASE_DIR/../../armnn $WORKING_DIR/armnn
+        if [[ $CREATE_LINKS = 1 ]]; then
+            if [[ -d $BASE_DIR/../../armnn ]]; then
+                echo "+++ Linking Arm NN"
+                echo "$BASE_DIR"
+               ln -s $BASE_DIR/../../armnn $WORKING_DIR/armnn
+           else
+               echo "Couldn't find Arm NN to link"
+           fi
         else
             echo "+++ Cloning Arm NN"
-            git clone https://review.mlplatform.org/ml/armnn.git armnn
+            git clone https://github.com/ARM-software/armnn.git armnn
             cd armnn
 
             git checkout $ARMNN_BRANCH
             git log -1
-        fi
+       fi
     fi
 }
 
@@ -188,7 +193,7 @@
                 ln -s $BASE_DIR/../../ComputeLibrary $WORKING_DIR/ComputeLibrary
             else
                 echo "+++ Cloning ComputeLibrary"
-                git clone https://review.mlplatform.org/ml/ComputeLibrary.git ComputeLibrary
+                git clone https://github.com/ARM-software/ComputeLibrary.git ComputeLibrary
                 cd ComputeLibrary
                 git checkout $($BASE_DIR/../../armnn/scripts/get_compute_library.sh -p)
                 git log -1
@@ -196,7 +201,7 @@
         else
             echo "+++ Cloning ComputeLibrary"
 
-            git clone https://review.mlplatform.org/ml/ComputeLibrary.git ComputeLibrary
+            git clone https://github.com/ARM-software/ComputeLibrary.git ComputeLibrary
             cd ComputeLibrary
             git checkout $ACL_BRANCH
             git log -1