Coder Social home page Coder Social logo

objectbox / objectbox-examples Goto Github PK

View Code? Open in Web Editor NEW
396.0 21.0 93.0 995 KB

Examples for ObjectBox Android/Java, the super-fast database

Home Page: http://objectbox.io

License: Apache License 2.0

Java 69.27% Kotlin 30.70% Shell 0.03%
android database examples java kotlin

objectbox-examples's Introduction

ObjectBox Java and Kotlin examples

Java and Kotlin examples for ObjectBox (GitHub), the superfast object-oriented database.

For examples in other languages, see the GitHub repository for that language.

Basics

  • 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 and kotlin-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).
  • java-main-vector-search: a cities and coordinates command-line application that shows how to do on-device ANN vector search.

Using Sync

Other

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 MyObjectBox. 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.

Links

ObjectBox Documentation

ObjectBox Features

ObjectBox GitHub repository

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

    https://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.

objectbox-examples's People

Contributors

greenrobot avatar greenrobot-team avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectbox-examples's Issues

ObjectBox DaoCompat

I want to migrate your existing greenDAO data to ObjectBox.

// note example
List<com.example.app.daos.greendao.Note> notes = daoSession.getNoteDao().loadAll();
List<Note> convertedNotes = convertToObjectBoxNotes(notes);
daoCompatSession.getNoteDao().insertInTx(convertedNotes);

GreenDao is promoted to ObjectBox, I don’t know how to convert ‘converttoObjectBoxnotes’. Can you provide a specific instance?

bintray-objectbox-objectbox

<pluginRepositories>
    <pluginRepository>
        <id>bintray-objectbox-objectbox</id>
        <name>bintray-plugins</name>
        <url>https://dl.bintray.com/objectbox/objectbox</url>
    </pluginRepository>
</pluginRepositories>

Address unavailable

How to remove the last data?

In my case , I want to keep 1,000 datas. I wonder if there is some way to remove the oldest data when I insert the 1001 data ? Thanks !

can't generate MyObjectBox class...

My Project has three modules include main module(app) and common module、chat module.
the app module and other module rely on the common module because I put all of the 3rd dependencies in it,also other common codes.

But I can't find the MyObjectBox class after build the project.so I put the dependencies in all three modules, but when I build the project it throw the exception:

Multiple dex files define Lio/objectbox/android/AndroidObjectBrowserReceiver;

So,how to fix this?
Early thanks...

Annotation processor fails at Eclipse

Hi, tried to switch to ObjectBox one of my hobby projects and realized its annotation processing doesn't work with Eclipse :(

Steps to reproduce:

  1. Clone this repo.
  2. Add apply plugin: 'net.ltgt.apt-eclipse' and apply plugin: 'eclipse' into build.gradle of java-main.
  3. Do gradlew cleanEclipse eclipse.
  4. Open the projects in Eclipse.

Expected result: generated sources appear in .apt_generated folder.
Actual result: they are not and the error log shows the "dir.parentFile must not be null" error (see full stacktrace here ).

SO states File.getParentPath() returning null may be fixed with adding getAbsoluteFile() before it: dir.getAbsoluteFile().getParentPath() - is it the case?

Tech details

eclipse.buildId=4.8.0.I20180308-0630
java.version=1.8.0_171
java.vendor=Oracle Corporation
OS: Ubuntu 18.04 x64
Project root: $HOME/git/objectbox-examples

[enhancement] Move to RecyclerView

Hello. Glad to see new mobile database!

In my opinion, a great mobile database should help in creating lists, that update their contents just after transaction and help in notifying adapter about these changes.

I use GreenDAO with RecyclerView, my own adapter, and DiffUtil.
https://developer.android.com/reference/android/support/v7/util/DiffUtil.html
Just after transaction I'm notifying all subscribers about a change and calculating diff in a background thread, so I can apply diff to adapter instead of using ugly notifyDataSetChanged.
To satisfy DiffUtil, I hold an array of old IDs in adapter, and bring an array of new ids along with a set of IDs of changed within transaction items.

It also was quite ugly with Realm, because there was no way to query a database for primary keys. With GreenDAO it was possible by querying raw SQLite database.

Summarizing, I expect from modern mobile database support diffs and update notifications.

200000+ DB select data used time too long

Hi,I have some problems and need your help.
My English is not very good,I don't know if you can understand what I mean.

I try to used Object Box query databases with a size of 200,000+.

My entity like this:

@Entity
@Uid(4111249737719887255L)
public class Song {
    @Id
    private long id;
    private int songID;
    @Index
    private String songName;
   @Index
    private String firstLetter;
    @Index
    private int clickNum;
    private int isBan;
...
}

My select code like this:

public void onSelectButtonClick(View view) {
        long start = System.currentTimeMillis();
        QueryBuilder<Song> builder = mSongBox.query();
        builder.equal(Song_.isBan, 0)
                .contains(Song_.songName, editText.getText().toString())
                .startsWith(Song_.firstLetter, editText.getText().toString())
                .orderDesc(Song_.clickNum);
        List<Song> songs = builder
                .build()
                .find(0, 27);
        Log.w("test", "onSelectButtonClick: sued: " + (System.currentTimeMillis() - start));
    }

log like this:

W/test: onSeleteButtonClick: sued: 458

Querying a single piece of data takes 458 milliseconds.

I want to reduce the time-consuming.
Is there any optimization plan?
Looking forward to your reply,thanks.

Objectbox with retrofit

I am using ObjectBox and I want to use it with retrofit but, I have to parse manually rather than, automatically parsed using Gson.is there a way to automatically parse the ObjectBox model?? Thank you.

Objectbox Browser .... more clear doc

Not a bug, just some hint to some of you.

If you want to use the browser app your application needs

<uses-permission android:name="android.permission.INTERNET" />

otherwise it will not run, and it will not mention anything in the log on why it doesn't run.

lost some time debugging this.

ToMany

Hello,I don't understand how tomany is used in the example.
How do I implement tomany annotations after I use Gsonformat to generate code?

box1

{ "code": 0, "data": [ { "city": "City", "sign": "Sign" }, { "city": "City1", "sign": "Sign1" } ], "debugMsg": "", "msg": "", "pageInfo": { "count": 20, "hasMore": 0, "page": 1, "pageCount": 1, "total": 2 } }

When developing desktop applications using kotlin,need use kapt process annotation

if follow use 'net.ltgt.apt-idea' in the document ,it not work,
need use kapt,like this:

buildscript {
    ext.objectboxVersion = '2.1.0'
    repositories {
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
    }
}

plugins {
    id 'java'
    id 'org.jetbrains.kotlin.jvm' version '1.2.61'
}

apply plugin: 'kotlin-kapt'
apply plugin: 'application'
apply plugin: 'io.objectbox'

group 'com.longforus'
version '1.0-SNAPSHOT'

repositories {
    jcenter()
    mavenCentral()
}
compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
sourceCompatibility = 1.8

mainClassName = "com.longforus.apidebugger.MainKt"
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'lib')
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    // Optional: include all native libraries for distribution
    implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
    implementation "io.objectbox:objectbox-linux:$objectboxVersion"
    implementation "io.objectbox:objectbox-macos:$objectboxVersion"
    implementation "io.objectbox:objectbox-windows:$objectboxVersion"
    implementation "io.objectbox:objectbox-java:$objectboxVersion"
    kapt "io.objectbox:objectbox-processor:$objectboxVersion"
}



// enable debug output for plugin
objectbox {
    debug true
}
// enable debug output for annotation processor
tasks.withType(JavaCompile) {
    options.compilerArgs += [ "-Aobjectbox.debug=true" ]
    options.compilerArgs += [ "-Aobjectbox.modelPath=$projectDir/schemas/objectbox.json" ]
}

I want to say in the document,It's convenient for other people

Support for MacOS desktop

Currently supported platforms are Linux and Windows, but majority of android devs uses MacOS, add support for Mac users, please!

if (isLinux64) {
compile "io.objectbox:objectbox-linux:$objectboxVersion"
} else if (isWindows64) {
compile "io.objectbox:objectbox-windows:$objectboxVersion"
} else println("Native dependency could not be set up for unsupported OS: " + osName)

Cant send @Entity objects through Intent when have Relations

I have class (Person) which have relation

@BackLink ToMany<AccessKey
and AccessKey is Entity class too.

@Entity
public class Person implements Serializable{

	@Id private long id;

	private String name;
	private int salary;
	private String favoriteColor;
	private String gender;

	@Backlink
	public ToMany<AccessKey> accessKeys;
......

and Here is AccessKey class:

@Entity
public class AccessKey implements Serializable{

	@Id private long id;
	private String logNumber;
	private String encryptedData;

	public ToOne<Person> person;

The problem happens when i put person in Intent as Serializable Extra and send it to Activity B and then trying to fetch it:

 Intent intent = getIntent();
		if(intent != null){
			Bundle bundle = intent.getExtras();
			if(bundle.containsKey("person")){
				mPerson = (Person) bundle.getSerializable("person");
				Log.i("","");
			}
		}

and it throw exception at line : bundle.containsKey("person")

the weird thing is befeor i added relation to Person class it worked good.

Here the exception:

06-12 16:09:57.045 6741-6741/com.outlocks.objectboxexample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.outlocks.objectboxexample, PID: 6741
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.outlocks.objectboxexample/com.outlocks.objectboxexample.UserActivity}: java.lang.RuntimeException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = com.outlocks.objectboxexample.Person)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: java.lang.RuntimeException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = com.outlocks.objectboxexample.Person)
        at android.os.Parcel.readSerializable(Parcel.java:2956)
        at android.os.Parcel.readValue(Parcel.java:2742)
        at android.os.Parcel.readArrayMapInternal(Parcel.java:3058)
        at android.os.BaseBundle.unparcel(BaseBundle.java:257)
        at android.os.BaseBundle.containsKey(BaseBundle.java:435)
        at com.outlocks.objectboxexample.UserActivity.onCreate(UserActivity.java:49)
        at android.app.Activity.performCreate(Activity.java:7174)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6938) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
     Caused by: java.lang.ClassNotFoundException: long
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at android.os.Parcel$2.resolveClass(Parcel.java:2942)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1616)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
        at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1487)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1337)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1927)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1927)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1927)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1927)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
        at android.os.Parcel.readSerializable(Parcel.java:2950)
        at android.os.Parcel.readValue(Parcel.java:2742) 
        at android.os.Parcel.readArrayMapInternal(Parcel.java:3058) 
        at android.os.BaseBundle.unparcel(BaseBundle.java:257) 
        at android.os.BaseBundle.containsKey(BaseBundle.java:435) 
        at com.outlocks.objectboxexample.UserActivity.onCreate(UserActivity.java:49) 
        at android.app.Activity.performCreate(Activity.java:7174) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6938) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "long" on path: DexPathList[[zip file "/data/app/com.outlocks.objectboxexample-ePYheKslwjuvkFzvs8aJHA==/base.apk"],nativeLibraryDirectories=[/data/app/com.outlocks.objectboxexample-ePYheKslwjuvkFzvs8aJHA==/lib/arm64, /data/app/com.outlocks.objectboxexample-ePYheKslwjuvkFzvs8aJHA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
06-12 16:09:57.046 6741-6741/com.outlocks.objectboxexample E/AndroidRuntime:     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        	... 42 more

Compile failed after add @Uid

I want to test rename the module Properties use @uid follow the docs, but it b;uild error and not tell you the uids like docs, it show compile failed, it work well if i don't use @uid
Here is my error message:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileAutomationDebugJavaWithJavac'
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.

Objectbox-example : RTE bug introduced due to code extraction for objectbox-relation-example.

A simple bug, but this causes a Run Time Exception, when running the latest version off the app : somewhere along the line, in the file NoteActivity, the call to the Add button got a "Button" type view parameter instead of a "View" type (in ReactiveNoteActivity, it's still the original code):

public void onAddButtonClick(Button view) { addNote(); }

was before (and should be , as far as I understand) :

public void onAddButtonClick(View view) { addNote(); }

Changing entity variable type causes error

I had an entity which had

int variableName;

but changing to

String variableName;

Caused an error,though i had cleaned,rebuild & make project
I had to uninstall app and install again.
How do i rebuild & commit the migration changes without uninstalling the app ?

Need more example in Transaction Insert and Query

From this documentation, there are several transaction in ObjectBox
http://objectbox.io/documentation/transactions/

The class BoxStore offers the following methods to perform explicit transactions:
runInTx: Runs the given runnable inside a transaction.
runInReadTx: Runs the given runnable inside a read(-only) transaction. Unlike write transactions, multiple read transactions can run at the same time.
runInTxAsync: Runs the given Runnable as a transaction in a separate thread. Once the transaction completes the given callback is called (callback may be null).
callInTx: Like runInTx(Runnable), but allows returning a value and throwing an exception.

But I found little confused for runInTxAsync implementation. Any good example about how to implementation those transaction ?

objectbox-kotlin-example unresolved reference

When I try objectbox like kotlin-example I ever obtain an unresolved reference in the call to build in ObjectBox class:

class App : Application() {
companion object Constants {
const val TAG = "ObjectBoxExample"
}

override fun onCreate() {
    super.onCreate()
    ObjectBox.buil(this)
}

}

ObjectBox.build(this) =====> build is unresolved reference

This is de ObjectBox class:

class ObjectBox {
lateinit var boxStore: BoxStore
private set

fun build(context: Context) {
    boxStore = MyObjectBox.builder().androidContext(context.applicationContext).build()
}

}

Can‘t find MyObjectBox

project build.gradle:

buildscript { ext.objectboxVersion = '1.4.3' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion" } }

app build.gradle:
apply plugin: 'io.objectbox'

Can't find MyObjectBox !

Having greenDao and ObjectBox at the same time

I am using greenDAO with Rx queries in my life app now. And I would like to migrate to using ObjectBox instead. I found some documentation about how I should set up the things during migration from one service to another but I find documentation and examples here conficting:
in the objectbox/objectbox-examples you do not include
compile "io.objectbox:objectbox-android:$objectboxVersion"
annotationProcessor "io.objectbox:objectbox-processor:$objectboxVersion"
into the gradle file, but only
implementation "org.greenrobot:objectbox-daocompat:1.1.0"

At the same time I cannot get the DaoCompatSession to get generated. I still find the reference to the greendDao's DaoSession only.
Do you have an example of the project should be setup when having both greenDao and DaoCompat at the same time? I am sure a lot of people would appreciate it.
Do you have proguard configuration for objectBox and DaoCompat, haven't noticed that you mention it somewhere?

couldn't find "libobjectbox.so"

error info:
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.pyraimds-2/base.apk"],
nativeLibraryDirectories=[/data/app/org.pyraimds-2/lib/arm, /system/fake-libs,
/data/app/org.pyraimds-2/base.apk!/lib/armeabi, /system/lib, /vendor/lib, /system/vendor/lib, /product/lib]]]
couldn't find "libobjectbox.so"

build.gradle:
...
ndk {
abiFilters "armeabi"
}
...

how to do?

filepath erro?

io.objectbox.exception.DbException: Could not create directory: /objectbox
at io.objectbox.BoxStore.getCanonicalPath(BoxStore.java:253)
at io.objectbox.BoxStore.(BoxStore.java:200)
at io.objectbox.BoxStoreBuilder.build(BoxStoreBuilder.java:383)

desktop-test-example gradle build fails

I'm getting

Error:(23, 21) Failed to resolve: io.objectbox:objectbox-windows:0.9.12,

when I uncommented
include 'desktop-test-example'
in settings.gradle (using a Windows machine)

Error:Could not find io.objectbox:objectbox-gradle-plugin:1.3.4

project.build gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
//ext.objectboxVersion = '1.3.4'
repositories {
google()
jcenter()
maven {
url "http://objectbox.net/beta-repo/"
}
}
dependencies {
// need to include in top build file
// https://developer.android.com/studio/build/gradle-plugin-3-0-0.html#known_issues
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.objectbox:objectbox-gradle-plugin:1.3.4"
}
}

allprojects {
    repositories {
        maven { url "http://objectbox.net/beta-repo/" }
        google()
        jcenter()
        mavenCentral()
    }
}

repositories {
    maven { url "http://objectbox.net/beta-repo/" }
    jcenter()
    mavenCentral()
    google()
}

app.build gradle file

buildscript {
dependencies {
classpath "io.objectbox:objectbox-gradle-plugin:1.3.4"
}
}
apply plugin: 'com.android.application'

dependencies {
    debugImplementation "io.objectbox:objectbox-android-objectbrowser:1.3.4"
    releaseImplementation "io.objectbox:objectbox-android:1.3.4"
    compile 'io.objectbox:objectbox-java:1.3.4'
    annotationProcessor "io.objectbox:objectbox-processor:1.3.4"
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}
apply plugin: 'io.objectbox'


defaultConfig {
    applicationId "com.example.novo0007.objectbox"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Error:

image

Failed to add to existing project that already using greenDAO

2017-01-30 12:41:23,320 [ 21734] WARN - nal.AbstractExternalSystemTask - Unable to find method 'org.greenrobot.greendao.codemodifier.SchemaOptions.(Ljava/lang/String;ILjava/lang/String;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V'.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Unable to find method 'org.greenrobot.greendao.codemodifier.SchemaOptions.(Ljava/lang/String;ILjava/lang/String;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V'.
at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.createUserFriendlyError(ProjectImportErrorHandler.java:288)
at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:196)
at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:401)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:772)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-01-30 12:41:23,336 [ 21750] WARN - radle.project.ProjectSetUpTask -
2017-01-30 12:41:23,336 [ 21750] INFO - radle.project.ProjectSetUpTask - Unable to find method 'org.greenrobot.greendao.codemodifier.SchemaOptions.(Ljava/lang/String;ILjava/lang/String;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V'.

Feature Request: Support for Flutter

I've been using Flutter (Dart) for a few projects, and really missed the ease-of-use that comes with ObjectBox. When I saw the awesome news of ObjectBox for Swift, it made me think there may be some possibility for either a port to Dart, or a bridge-like library which lets your Flutter app use ObjectBox-Swift on IOS, and ObjectBox-Java on Android.

Repo seems to be offline

I cannot access http://objectbox.net/beta-repo/

Trying to import objectbox 1.0.0

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta4'
        classpath 'io.objectbox:objectbox-gradle-plugin:1.0.0'
    }
}

allprojects {
    repositories {
        maven { url "http://objectbox.net/beta-repo/" }
        google()
        jcenter()
    }
}

AndroidStudio is giving me this message

Error:Could not find io.objectbox:objectbox-gradle-plugin:1.0.0.
Searched in the following locations:
    file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.pom
    file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.jar
    https://dl.google.com/dl/android/maven2/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.pom
    https://dl.google.com/dl/android/maven2/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.jar
    https://jcenter.bintray.com/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.pom
    https://jcenter.bintray.com/io/objectbox/objectbox-gradle-plugin/1.0.0/objectbox-gradle-plugin-1.0.0.jar

I also cannot access the repo in the browser, it's giving me a "403 Forbidden" error.
Is the repo offline or am I doing something wrong?

Add data using ObjectBox

I want to directly enter data into Database using Objectbox browser.
Can you please guide how to do that?

Cannot resolve MyObjectBox

I have followed all the minimal setup requirements,gradle buils ok but if i create the App for initializing the BoxStore,i receive the error "cannot resolve symbol MyObjectBox"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.