Android version of example application "NavCog".
- Android Studio and Android SDK (Android 13 SDK 33 or later)
- CocoaPods (1.6.1 or later)
- cmake (3.15.2 or later)
- HULOP blelocpp (MIT License)
- OpenCV (OpenCV-Dynamic) 4.0.1 (BSD License)
Please put libopencv_java4.so from Android pack OpenCV-android-sdk (under /sdk/native/libs folder) into folders below:
- /app/src/main/jniLibs/arm64-v8a
- /app/src/main/jniLibs/armeabi-v7a
- /app/src/main/jniLibs/x86_64
OpenCV-android-sdk can be found at https://opencv.org/releases/.
(Currently, HULOP uses version 4.0.1. If needed, please use an appropriate version of so file.)
- Install and update Homebrew
- $brew install python
- $pip install mercurial
- Install CocoaPods
- $brew instal cmake
- Follow instructions of blelocpp
- If you want to build Android version only, you don't need to do the final step ($sh build.sh Release).
-
If OpenCV-Dynamic4.0.1 can't install well. Please try to use Homebrew as below.
- $brew install opencv
- $cd blelocpp/platform/ios
- Comment out the line below from Podfile.
pod 'OpenCV-Dynamic', '4.0.1'
- $pod install
- Modify NavCogAndroid/app/CMakeLists.txt to include OpenCV as below.
# Use OpenCV via Homebrew include_directories(/usr/local/opt/opencv/include/opencv4)
- Go to Build step. (Step 3 below is not required.)
-
If
Pods/Headers/Public/OpenCV-Dynamic
does not exist, copy header files intoPods/Headers/Public/OpenCV-Dynamic
.cd blelocpp/platform/ios mkdir -p Pods/Headers/Public/OpenCV-Dynamic/opencv2 cp -R Pods/OpenCV-Dynamic/opencv2.framework/Headers/ Pods/Headers/Public/OpenCV-Dynamic/opencv2
Build the example app by using Android Studio.
- Enable adb shell
- Install adb with Android Studio, and then add PATH for it. (For example, add line below into ~/.bashrc)
export PATH=$PATH:$HOME/Library/Android/sdk/platform-tools
- Find target folder in the Android device.
- Connect target Android device with Mac, and then start
adb shell
- Find target folder (
/storage/self/primary/Android/data/hulop.navcog/files
is the default.) - After confirm the target folder,
exit
from adb.
- Copy serverlist file(serverlist.txt or serverlist.json) into the target folder as below.
adb push serverlist.[txt|json] /storage/self/primary/Android/data/hulop.navcog/files
Please try one of steps below, and try build again.
- Delete
blelocpp/platform/ios/Pods
, and thenpod install
- Build→Clean Project, Build→Refresh Linked C++ Projects in Android Studio.