Loading Data – SQLite DB vs. ObjectBox DB

Loading Data – SQLite DB vs. ObjectBox DB

Code Example n°1

Beautiful
Code

Loading data.
In just 2 lines.

LOADING DATA FROM A MOBILE DATABASE

Loading data in a Mobile App can be lenghty… if you work with SQLite directly. That’s why we built the fastest ORM on the market: greenDAO. With greenDAO its only 2 lines of code. With ObjectBox, our Mobile Database, its also 2 lines of code. Objectbox simply gives you additional speed out of the box. If you are already working with greenDAO, you can switch to using ObjectBox almost seamlessly. Check out our greenDAO CompatLayer to learn how you can easily switch and boost your app performance with minimal effort.

CODE COMPARISON

SQlite / greenDAO / ObjectBox

SQLITE DATABASE

String[] columns = { “note”, “date_changed” };

String[] idArgs = { String.valueOf(id) };

SQLiteCursor cursor = (SQLiteCursor) db.query(“notes”, columns, “_id=?”, idArgs, null, null, “note”);

try {

if (cursor.getCount() != 1) {

throw new Exception(“Unexpected count: ” +cursor.getCount());

}

cursor.moveToNext();

String note = cursor.getString(0);

String date = cursor.getString(1);

updateUi(note, date);

} finally {

cursor.close();

}

GREENDAO ORM

Note note = noteDao.load(id);

updateUi(note.getNote(), note.getDate());

OBJECTBOX DB

Note note = noteBox.get(id);

updateUi(note.getNote(), note.getDate());

ObjectBox 0.9.10 – getting closer to 1.0

ObjectBox 0.9.10 – getting closer to 1.0

ObjectBox 0.9.10 - getting closer to 1.0

Do you know our new super fast mobile database ObjectBox yet? With versions 0.9.9 and the just released 0.9.10, ObjectBox made great progress to stabilize features for the 1.0 release. With an increasing number of apps using ObjectBox, we were able to spot and fix some less obvious issues. We believe that ObjectBox 0.9.10 is the most stable release ever. If you did not dare to check out the beta version yet: now is a good time to have a closer look.

(more…)

ObjectBox – The new Mobile Database (Beta)

ObjectBox – The new Mobile Database (Beta)

ObjectBox – The new Mobile Database (Beta)

 

ObjectBox is a new mobile object database optimized for performance. With ObjectBox, we are bringing technology from NoSQL server databases to mobile. We are impressed by the resulting performance advantage and invite you to try it for yourself. Go make your apps run faster!
(more…)