ObjectBox Java and Kotlin examples
For examples in other languages, see the GitHub repository for that language.
- android-app-kotlin: a note taking app that shows how to define the data model, indexes and relations, create a store, put and get data, use Admin UI and create unit tests.
- android-app: a more basic variant of the above written in Java.
- java-main: a note taking command-line application that shows how to define the data model, create a store and put and get data.
- java-main-maven: the above app but using a Maven project (we recommend to use Gradle).
- android-app-sync-kotlin: a task list app that shows how to define a data model for Sync and configure a Sync client.
- android-app-sync: the above app written in Java.
- android-app-relations: shows how to use all types of available relations.
- android-app-arch: shows how to use ObjectBoxLiveData with ViewModel and ObjectBoxDataSource with the Paging library.
- android-app-multimodule: shows how to use a separate database in each feature module.
- android-app-multiprocess: shows how to use ObjectBox from a different process.
- android-app-daocompat: shows how to use the DAOcompat compatibility layer to help migrate from greenDAO.
- java-performance: a command-line application that runs performance tests with ObjectBox.
MyObjectBox missing? Build the project!
When you open the project in an IDE like Android Studio for the first time, it will complain that it does not find the class
This is expected because this class is generated during build time.
Thus, once you build the project, everything should be fine.
Issues and feedback
If you are looking for help with how to use ObjectBox see our documentation.
If you found an issue or have feedback about these examples feel free to submit an issue for objectbox-java.