ProductPromotion
Logo

Kotlin

made by https://0x3d.site

GitHub - objectbox/objectbox-java: Android Database - first and fast, lightweight on-device vector database
Android Database - first and fast, lightweight on-device vector database - objectbox/objectbox-java
Visit Site

GitHub - objectbox/objectbox-java: Android Database - first and fast, lightweight on-device vector database

GitHub - objectbox/objectbox-java: Android Database - first and fast, lightweight on-device vector database

ObjectBox - Fast and Efficient Java Database (Android, JVM) with Vector Search

ObjectBox Java is a lightweight yet powerful on-device database & vector database designed specifically for Java and Kotlin applications. Store and manage data effortlessly in your Android or JVM Linux, macOS or Windows app with ObjectBox. Easily manage vector data alongside your objects and perform superfast on-device vector search to empower your apps with RAG AI, generative AI, and similarity search. Enjoy exceptional speed, battery-friendly resource usage, and environmentally-friendly development. 💚

Demo code

// Java
Playlist playlist = new Playlist("My Favorites");
playlist.songs.add(new Song("Lalala"));
playlist.songs.add(new Song("Lololo"));
box.put(playlist);

➡️ More details in the docs

// Kotlin
val playlist = Playlist("My Favorites")
playlist.songs.add(Song("Lalala"))
playlist.songs.add(Song("Lololo"))
box.put(playlist)

Table of Contents

Key Features

🧠 First on-device vector database: easily manage vector data and perform fast vector search 🏁 High performance: exceptional speed, outperforming alternatives like SQLite and Realm in all CRUD operations.
💚 Efficient Resource Usage: minimal CPU, power and memory consumption for maximum flexibility and sustainability.
🔗 Built-in Object Relations: built-in support for object relations, allowing you to easily establish and manage relationships between objects.
👌 Ease of use: concise API that eliminates the need for complex SQL queries, saving you time and effort during development.

Getting started

Gradle setup

For Android projects, add the ObjectBox Gradle plugin to your root build.gradle:

buildscript {
    ext.objectboxVersion = "4.0.3"
    repositories {        
        mavenCentral()    
    }
    dependencies {
        classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion")
    }
}

And in your app's build.gradle apply the plugin:

// Using plugins syntax:
plugins {
    id("io.objectbox") // Add after other plugins.
}

// Or using the old apply syntax:
apply plugin: "io.objectbox" // Add after other plugins.

First steps

Create a data object class @Entity, for example "Playlist".

// Kotlin
@Entity data class Playlist( ... )

// Java
@Entity public class Playlist { ... }

Now build the project to let ObjectBox generate the class MyObjectBox for you.

Prepare the BoxStore object once for your app, e.g. in onCreate in your Application class:

boxStore = MyObjectBox.builder().androidContext(this).build();

Then get a Box class for the Playlist entity class:

Box<Playlist> box = boxStore.boxFor(Playlist.class);

The Box object gives you access to all major functions, like put, get, remove, and query.

For details please check the docs.

Why use ObjectBox for Java data management?

ObjectBox is a NoSQL Java database designed for local data storage on resource-restricted devices, prioritizing offline-first functionality. It is a smart and sustainable choice for local data persistence in Java and Kotlin applications. It offers efficiency, ease of use, and flexibility.

Fast but resourceful

Optimized for speed and minimal resource consumption, ObjectBox is an ideal solution for mobile devices. It has excellent performance, while also minimizing CPU, RAM, and power usage. ObjectBox outperforms SQLite and Realm across all CRUD (Create, Read, Update, Delete) operations. Check out our Performance Benchmarking App repository.

Simple but powerful

With its concise language-native API, ObjectBox simplifies development by requiring less code compared to SQLite. It operates on plain objects (POJOs) with built-in relations, eliminating the need to manage rows and columns. This approach is efficient for handling large data volumes and allows for easy model modifications.

Functionality

💐 Queries: filter data as needed, even across relations
💻 Multiplatform: supports Android and JVM on Linux (also on ARM), Windows and macOS
🌱 Scalable: handling millions of objects resource-efficiently with ease
🦮 Statically typed: compile time checks & optimizations
📃 Automatic schema migrations: no update scripts needed

And much more than just data persistence
🔄 ObjectBox Sync: keeps data in sync between devices and servers
🕒 ObjectBox TS: time series extension for time based data

Community and Support

Tell us what you think! Share your thoughts through our Anonymous Feedback Form.

At ObjectBox, we are dedicated to bringing joy and delight to app developers by providing intuitive and fun-to-code-with APIs. We genuinely want to hear from you: What do you love about ObjectBox? What could be improved? Where do you face challenges in everyday app development?

We eagerly await your comments and requests, so please feel free to reach out to us:

  • Add GitHub issues
  • Upvote important issues 👍
  • Drop us a line via @ObjectBox_io or contact[at]objectbox.io
  • ⭐ us on GitHub if you like what you see!

Thank you! Stay updated with our blog.

Changelog

For notable and important changes in new releases, read the changelog.

Other languages/bindings

ObjectBox supports multiple platforms and languages. Besides JVM based languages like Java and Kotlin, ObjectBox also offers:

License

Copyright 2017-2024 ObjectBox Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Note that this license applies to the code in this repository only. See our website on details about all licenses for ObjectBox components.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory