Skip to content

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

  1. Open Android Studio
  2. Select Native C++ Project or Create a new Android project with C++ Support
  3. Select C++17 as the standard
  4. Set arm64-v8a as the target architecture

2️⃣ Add SDK Header Files

  1. Copy all VecML SDK header files (.h) to your project's cpp/include directory.
  2. Open CMakeLists.txt and add the following:
include_directories(${CMAKE_SOURCE_DIR}/cpp/include)

3️⃣ Add Shared Libraries

  1. Copy libfluffy_shared_lib.so and libomp.so to app/src/main/cpp/libs/<ABI>/
  2. Example folder structure:
    app/src/main/cpp/libs/arm64-v8a/libfluffy_shared_lib.so
    app/src/main/cpp/libs/arm64-v8a/libomp.so
  3. 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
)
  1. 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. 🚀


📌 For Detailed SDK APIs: