ObjectBox Data Browser

The ObjectBox data browser (short: object browser) allows you to view the entities and schema of your database inside a regular web browser. You can also download entities in JSON format. The object browser runs directly on your device or on your development machine. Behind the scenes this works by bundling a simple HTTP browser into ObjectBox when building your app. If triggered, it will then provide a basic web interface to the data and schema in your box store.

Setup

We  strongly recommend to use the object browser only for debug builds. Make sure that you apply the “io.objectbox” plugin after the dependencies block:

Ensure that the INTERNET permission is present in the Android manifest as the object browser binds to a local port:

After creating your box store, start the object browser. Typically in your Application onCreate method:

Browse data on your device

When the app starts an object browser notification should appear. Tapping it will launch a service to keep the app alive and opens the data browser interface in the web browser on the device.

To stop the service keeping your app alive, tap the ‘Stop’ button in the notification.

Browse data on your dev machine

To open the browser website on your development machine check the Logcat output when launching the app. It will print the port and the ADB command needed to forward the port to your machine:

If available, port 8090 is used by default. So in most cases just run this command on your dev machine:

Once the port is forwarded you can open a browser and go to http://localhost:8090/index.html .

Download entities

When viewing entities tap the download button at the very bottom. This will download entities formatted as JSON.

Next steps

 

Spread the love
Sign up for fresh ObjectBOX news here. No spam, just fresh developer news once in a while.
x