Git Product home page Git Product logo

realm-browser's Introduction

Description

This library project provides a convenient way for Android developers to see the contents of their Realm database files on the device.

It's a fork of dmytrodanylyk/realm-browser which was originally created by Danylyk Dmytro but sadly discontinued.

Integration codecov

Releases: Build Status - Develop branch (Snapshots): Build Status

The project is available via JitPack.io.

  1. Add the JitPack repository to your build file
allprojects {
        repositories {
        ...
        maven { url "https://jitpack.io" }
        }
    }
}
  1. Add the dependency
dependencies {
    debugCompile 'com.github.jonasrottmann.realm-browser:realm-browser:0.0.14'
    testCompile 'com.github.jonasrottmann.realm-browser:realm-browser-no-op:0.0.14'
    releaseCompile 'com.github.jonasrottmann.realm-browser:realm-browser-no-op:0.0.14'
}

The no-op version of Realm Browser has empty functions which do nothing. It is not necessary to include this, but you may if you do not want to access Realm Browser in release mode. If you want to use a build of the newest development use compile "com.github.jonasrottmann.realm-browser:realm-browser:develop-SNAPSHOT" instead.

  1. Exclude support libraries (maybe optional): Realm Browser depends on Android support libraries, so you might want to exclude them from your project if they conflict with the ones you include:
depedencies {
    debugCompile ('com.github.jonasrottmann.realm-browser:realm-browser:0.0.14') {
        exclude group: 'com.android.support';
    }
}
  1. Add ProGuard rules (optional): Use these if you enable minification for debug builds or want to use Realm Browser in release builds.
# Realm Browser
-keep class de.jonasrottmann.realmbrowser.* { *; }
-keep class android.support.v7.widget.SearchView { *; }
-keep class android.support.v7.view.** { *; }

Usage

If you want to see all your database files:

RealmBrowser.startRealmFilesActivity(context);

If you want to see all the tables in a database call:

RealmBrowser.startRealmModelsActivity(context, realmConfiguration);

To display a notification from which the Realm Browser can be started:

RealmBrowser.showRealmFilesNotification(context);
RealmBrowser.showRealmModelsNotification(context, realmConfiguration);

There are also App Shortcuts available for devices running Android 7.1 or newer:

RealmBrowser.addFilesShortcut(context);
RealmBrowser.addModelsShortcut(context, realmConfiguration)

For a full working example check out the sample app.

TODO

What's on the roadmap... ๐Ÿš€

  • Tests
  • Be able to edit/create objects
  • Bidirectional scrolling in the browser window
  • Clean up
  • Nice architecture
  • Live reload the browser if updates happen in the background
  • Javadoc ๐Ÿ“š

Other browsers

If you're looking for a Realm browser for your iOS Swift projects check out bearjaw/RBSRealmBrowser ๐ŸŽ‰

License

The MIT License (MIT)

Original Work: Copyright (c) 2015 Danylyk Dmytro

Modified Work: Copyright (c) 2015 Rottmann, Jonas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

realm-browser's People

Contributors

degill avatar dmytrodanylyk avatar jacobmuchow avatar jonasrottmann 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

Watchers

 avatar  avatar  avatar  avatar

realm-browser's Issues

Compatible with AndroidX

When I click on the one row of table, I get this error:

Could not find class 'androidx.core.widget.NestedScrollView$AccessibilityDelegate', referenced from method androidx.core.widget.NestedScrollView.<clinit>

This error is about this line and is related to AndroidX, because realm-browser is not use AndroidX

Fixed with:

-keep class androidx.core.widget.NestedScrollView {*;}

Compatibility broke since Realm 0.91.0

Since Realm v0.91.0 all deprecated methods were remove. This is particular bad for the method DynamicRealm#allObjects used by the realm-browser. As such, the content of realm-tables can not be viewed, the app rather crashes.

This is concerning.

Follow relationships

It would be nice to be able to follow a relationship and open the related object in its class.

Android Oreo not supported

Hi,

It seems that Android Oreo is not supported.
The app run fine but the realm browser notification doesn't appear.
Can someone confirm this issue ?

Thanks. I hope I will still be able to use this amazing tool for debugging in the future !

Selection of fields to show do not persist

When changing the selection of fields to show for a given class, that selection will not be persisted and reset to default values when viewing that given class again.

It would be nice if such a selection can be made permanent.

Build fails if App uses FileProvider

Merging Errors: 
Error: Attribute provider#android.support.v4.content.FileProvider@authorities value=(...) from (unknown) is also present at AndroidManifest.xml:14:13-64 value=(de.jonasrottmann.realmbrowser). Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:72:9-80:20 to override. app develop manifest 
Error: Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from (unknown) is also present at AndroidManifest.xml:19:17-64 value=(@xml/realm_browser_filepaths). Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override. app develop manifest

Allow sharing of the/all realm files

It would be nice to have a share button to export the/all actual realm files to be able to view them within the realm-browser desktop client.

Cannot use custom RealmConfiguration

You cannot access the Realm by creating a new RealmConfiguration that differs from the one used to open the Realm file earlier. To make this library broadly useful, we should be passing in a RealmConfiguration, not a filename.

  java.lang.IllegalArgumentException: Configurations cannot be different if used to open the same file. 
                                                               Cached configuration: 
                                                               realmFolder: /data/user/0/.../files
                                                               realmFileName : filename
                                                               canonicalPath: /data/data/.../files/filename
                                                               key: [length: 0]
                                                               schemaVersion: 0
                                                               migration: null
                                                               deleteRealmIfMigrationNeeded: true
                                                               durability: FULL
                                                               schemaMediator: io.realm.DefaultRealmModuleMediator@537edaba

                                                               New configuration: 
                                                               realmFolder: /data/user/0/.../files
                                                               realmFileName : filename
                                                               canonicalPath: /data/data/.../files/filename
                                                               key: [length: 0]
                                                               schemaVersion: 0
                                                               migration: null
                                                               deleteRealmIfMigrationNeeded: false
                                                               durability: FULL
                                                               schemaMediator: io.realm

Conflics with realm version

Hi,

just followed the readme :

debugCompile('com.github.jonasrottmann.realm-browser:realm-browser:v0.0.9') {
    exclude group: 'com.android.support'
}
testCompile('com.github.jonasrottmann.realm-browser:realm-browser-no-op:v0.0.9') {
    exclude group: 'com.android.support'
}
releaseCompile('com.github.jonasrottmann.realm-browser:realm-browser-no-op:v0.0.9') {
    exclude group: 'com.android.support'
}

but got this :

Error:Conflict with dependency 'io.realm:realm-android-library' in project ':myproject'. Resolved versions for app (3.1.2) and test app (3.0.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
Error:Conflict with dependency 'io.realm:realm-annotations' in project ':myproject'. Resolved versions for app (3.1.2) and test app (3.0.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Could you do something not to get errors when realm version is different ?

edit : Between 3.0.0 and 3.1.2 they have done a migration, maybe that's why it's conflicting ?
I made it work with realm 3.0.0, thank you sooooo much for this ! So usefull for people without an OSX ๐Ÿ‘

Confusing toast error on encrypted realm files

Small thing I noticed. Adding encryption to the Realm file and not adding the correct configuration causes this toast to show up:

Can't open realm instance. You must close all open realm instances before opening this file.

Probably best to catch the specific realm exception for this situation to prevent any confusion.

Proguard issue

I get the following error when trying to build with minify enabled

Warning: de.jonasrottmann.realmbrowser.models.view.ModelsActivity: can't find referenced class de.jonasrottmann.realmbrowser.models.ModelsContract$SortMode

I have the rules in my proguard file as instructed

# Realm Browser -keep class de.jonasrottmann.realmbrowser.* { *; } -keep class android.support.v7.widget.SearchView { *; } -keep class android.support.v7.view.** { *; }

What am I doing wrong?

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.