Android SDK Installation
📌 Requirements, Installation, and Setup
Requirements
To use the VecML Android SDK, you need:
- Android Studio (Latest Version)
- Android NDK (Native Development Kit)
- CMake & Ninja (For C++ Builds)
- Android Device or Emulator (ARM64)
- C++17 or later
About License
Please contact sales@vecml.com to obtain a valid license.txt
. The license file is required to initialize and use the VecML SDK. Without a valid license, functionalities are restricted or unavailable. Ensure that the license.txt
file is placed in the correct directory and accessible by your application to avoid initialization errors.
📦 Installation
The SDK consists of:
libfluffy_shared_lib.so
(Main Shared Library)libomp.so
(OpenMP Support Library)- A set of header files (
.h
), including:fluffy_interface.h
(For Vector Database)fluffy_document_interface.h
(For Document Database)
You need to integrate these files into your Android Studio project.
🛠 Setup in Android Studio
Follow these steps to configure your Android project to use the VecML SDK:
1️⃣ Create a New Android Project
- Open Android Studio
- Select Native C++ Project or Create a new Android project with C++ Support
- Select C++17 as the standard
- Set arm64-v8a as the target architecture
2️⃣ Add SDK Header Files
- Copy all VecML SDK header files (
.h
) to your project'scpp/include
directory. - Open
CMakeLists.txt
and add the following:
include_directories(${CMAKE_SOURCE_DIR}/cpp/include)
3️⃣ Add Shared Libraries
- Copy
libfluffy_shared_lib.so
andlibomp.so
toapp/src/main/cpp/libs/<ABI>/
- Example folder structure:
app/src/main/cpp/libs/arm64-v8a/libfluffy_shared_lib.so app/src/main/cpp/libs/arm64-v8a/libomp.so
- Modify
CMakeLists.txt
to link these libraries:
set(LIBS_DIR ${CMAKE_SOURCE_DIR}/libs)
add_library(fluffy_shared_lib SHARED IMPORTED)
set_target_properties(fluffy_shared_lib PROPERTIES IMPORTED_LOCATION ${LIBS_DIR}/${ANDROID_ABI}/libfluffy_shared_lib.so)
target_link_libraries(
${PROJECT_NAME}
fluffy_shared_lib
log
)
- Add the
.so
libraries to the Gradle build system (app/build.gradle
):
android {
...
defaultConfig {
ndk {
abiFilters "arm64-v8a"
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
}
4️⃣ Include the Main Header in Your Code
To use all features of the SDK, include the following headers in your C++ source files:
#include "fluffy_interface.h" // Vector Database
#include "fluffy_document_interface.h" // Document Database
Now your project is set up, and you can start using the VecML Android SDK for vector and document search operations. 🚀