Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Browser App #6

Closed
greenrobot opened this issue Jan 24, 2017 · 27 comments
Closed

Object Browser App #6

greenrobot opened this issue Jan 24, 2017 · 27 comments
Labels
enhancement New feature or request
Milestone

Comments

@greenrobot
Copy link
Member

greenrobot commented Jan 24, 2017

Allow to open ObjectBox databases with a generic browser.

Main question: should this be something you can integrate into an app? Or do you prefer an desktop app? Or a web app?

Pro app:

  • no need to pull database files to the desktop

Pro desktop:

  • More screen estate
  • Also works for non-Android databases, e.g. desktop apps and unit tests

Pro web app (e.g. write server in Kotlin with embedded netty):

  • More screen estate
  • Can be accessed locally on the device or on the desktop
  • Also works for non-Android databases, e.g. desktop apps and unit tests
  • Remotely accessible, e.g. you could use ObjectBox on a server and connect to it

Pro Stetho

  • Existing infrastructure

What would you prefer and why?

@Bringoff
Copy link

I think, Stetho plugin would be enough for the first time. Realm users on Linux and Windows use such kind of database access because native realm browser app is only available for MacOS.

@xu6148152
Copy link

Very agree with you!

@EricKuck
Copy link

The realm browser app is fantastic for iOS development, since the simulator's filesystem lives on your Mac's filesystem. It's not really so useful for Android development though, due to having to pull DBs off the phone before being able to do anything.

If your primary usecase is Android, a Stetho plugin (or something that works like Stetho) is a great idea. If you want something that'll work cross-platform though, is there an option other than a desktop app?

@greenrobot
Copy link
Member Author

Actually, I think doing it as an embedded web server might be the best option in the long run. Maybe with web components (ping @mreichelt).

@mreichelt
Copy link

Yay, web components! :D
I also believe that a server containing a small web app would be the coolest way to do it.

@vRallev
Copy link

vRallev commented Jan 27, 2017

And it shouldn't be too hard to accomplish. Especially making it an optional debug only dependency could save a lot of time.

@greenrobot greenrobot added the enhancement New feature or request label Jan 28, 2017
@mreichelt
Copy link

@greenrobot I hacked something: https://github.com/mreichelt/ObjectBox-viewer

  1. Run the sample app
  2. Run adb forward tcp:8912 tcp:8912 to forward the internal port to the host machine
  3. Go to http://localhost:8912 and observe:

objectbox browser

Some notes:

  • Technically possible, yay!
  • Currently devs have to pass in the Entity classes, which we might be able to find via reflection -> yay
  • We might also get the Entity data via reflection -> yay
  • Currently devs have to start the HTTP server manually - this might be required because the viewer needs access to the BoxStore instance -> nay
  • For now I don't know if we can automate the port forwarding - this could be an issue for developers when the emulator/device is restarted/reconnected and they wonder why http://localhost:8912 does not work anymore

@greenrobot
Copy link
Member Author

@mreichelt Cool! Thanks for investigating.

Some comments:

  • NanoHTTPD sounds familiar, think I used it before. Nice that it also supports SSL and WebSockets.
  • In the same network, it should be possible to connect directly with the devices IP address, right? --> Log/show the IP.
  • There will be a generic interface to ObjectBox to enable discovering available object types. Also a generic way to access object's data (without knowing Java classes, think of an object more like Map<String,Object> with property name keys).

Btw, do you know a powerful datagrid web component? Saw the one from Vaadin on top of Polymer, but not sure about it..

@ArthurSav
Copy link

ArthurSav commented Feb 25, 2017

I'd go with a stetho plugin for the simple reason that it has virtually no overhead to setup.

@luozheng1985
Copy link

@ArthurSav where is the stetho plugin for objectbox?

@greenrobot
Copy link
Member Author

@luozheng1985 there is no steho plugin. We'll probably go a different route here.

@greenrobot
Copy link
Member Author

Update: we started working on this and want to release soon after 1.0.
The plan is to offer a web based data browser (using an embedded web server in a debug version of the library). Maybe Polymere based? Thoughts welcome.

@BenoitDuffez
Copy link

Please don't have the same strong connection Stetho uses. It's such a PITA to reattach each time the app is restarted!

@kosiarska
Copy link

kosiarska commented Sep 4, 2017

@greenrobot Hi, i just made simple objectbox browser based on https://github.com/amitshekhariitbhu/Android-Debug-Database.

Add, edit, delete operations are not supported (for now), only display.
You can download (if you want) library with sample project (made in As 2.3.3) from https://github.com/kosiarska/ObjectBoxDebugBrowser

Please tell me what you think. Btw. your libraries saved me many times :), thank you for your amazing work.

@greenrobot
Copy link
Member Author

@vinojvetha
Copy link

How to see the database and table in android mobiles

@vinojvetha
Copy link

How to write the database in sd card for seeing the data in android

@renyuzhuo
Copy link

renyuzhuo commented Nov 30, 2017

https://github.com/renyuzhuo/rviewer

Getting started

In your build.gradle:

 dependencies {
   debugCompile 'cn.renyuzhuo.rviewer:rviewer:1.0.2'
   releaseCompile 'cn.renyuzhuo.rviewer:rviewer-no-op:1.0.2'
 }

In your Application class:

public class App extends Application {

    private BoxStore boxStore;
    private static App app;

    @Override
    public void onCreate() {
        super.onCreate();
        boxStore = MyObjectBox.builder().androidContext(this).build();
        app = this;

        ArrayList<Class> classes = new ArrayList<>();
        classes.add(Note.class); // Your Entitys
        ObjectViewBoxManager.getInstance().init(boxStore, classes);
    }
}

Notice: You Should all Add toString() like:

    @Override
    public String toString() {
        return "Note{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", date=" + date +
                '}';
    }

All the things is done.

@Oo121oO
Copy link

Oo121oO commented Jan 18, 2018

Is there any desktop software can access data.mdb?@greenrobot

@iBotasky
Copy link

iBotasky commented Jan 21, 2018

I'm sorry , I use Stetho, but there is no any db file.
image
And I'm sure that I have a data.mdb file. I use RE can find the file
image
Why there is show nothing in the Stetho?
@Bringoff

@ArthurSav
Copy link

@iBotasky

I don't believe Stetho is supported.
You have to use the objectbox browser

@iBotasky
Copy link

@ArthurSav OK, Let me try for it, thanks!

@yvonneprice
Copy link

yvonneprice commented Jan 30, 2018

Hello all,
I created SQLScout, a plugin for Android Studio, that provides support for Sqlite:

  • Automatic generation of Room Entity, DAO and Database classes from existing database schemas.
  • Ability to connect to SQLite databases in Android devices (without downloading database files) and the file system
  • Database schema explorer (view tables, views, columns, primary keys, foreign keys, etc.)
  • SQL editor (syntax highlighting, code completion, reference navigation, refactoring, etc.)
  • Data console to view query results, edit table data, and export contents to different formats
  • Database diagrams
    (More details and demos here)

We are thinking about creating another plugin that provides similar features, but for ObjectBox (including automated migration from SQLite to ObjectBox.)

Our question is, would ObjectBox users consider using this plugin?

Many thanks in advance.

@ArthurSav
Copy link

@yvonneprice

Current implementation of the objectbox browser is nice but it lucks a lot of stuff. Also it forces you to go out of your flow(IDE) in order to debug.

So i'd probably use it given that it's part of intellij

@yvonneprice
Copy link

@ArthurSav
Thank you for your feedback. I completely agree, having all the tooling, including database management integrated in one place (inside IDE) minimizes context switching and flow interruptions, increasing developers' productivity.

@xuanswe
Copy link

xuanswe commented Jan 9, 2019

The idea of objectbox browser is nice but only work for Android project. I think we need a way to access the data file directly on Desktop.

@greenrobot-team
Copy link
Member

@nguyenxndaidev Please thumbs up or give #519 some love. -ut

This was referenced Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests