GithubHelp home page GithubHelp logo

wajahatkarim3 / dbflowmanager-hyperion-plugin Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 3.64 MB

The Hyperion plugin of DBFlowManager for viewing DBFlow databases in the app.

License: Apache License 2.0

Kotlin 22.15% Java 77.85%
hyperion hyperion-android dbflow dbflow-databases android android-library kotlin kotlin-android kotlin-library

dbflowmanager-hyperion-plugin's Introduction

DBFlowManager-Hyperion-Plugin

The Hyperion plugin of DBFlowManager for viewing DBFlow databases in the app.

Installation

First, follow the README to set up DBFlow. Then, follow the README to set up Hyperion. Then, all you need to do is simply add the dependency of DBFlowManager Hyperion Plugin and DBFlowManager like this in app's build.gradle file:

dependencies {
  // DBFlow Manager
  implementation 'com.wajahatkarim3.DBFlowManager:DBFlowManager:3.1.1-v1'
  
  // DBFLow Manager Hyperion Plugin
  debugImplementation 'com.wajahatkarim3.dbflowmanager-hyperion-library:dbflowmanager-hyperion-library:1.0.4'
  releaseImplementation 'com.wajahatkarim3.dbflowmanager-hyperion-library:dbflowmanager-hyperion-library-no-op:1.0.4'
}

Or add as a new dependency inside your pom.xml

<dependency>
  <groupId>com.wajahatkarim3.DBFlowManager</groupId>
  <artifactId>DBFlowManager</artifactId>
  <version>3.1.1-v1</version>
  <type>pom</type>
</dependency>

<dependency>
  <groupId>com.wajahatkarim3.dbflowmanager-hyperion-library</groupId>
  <artifactId>dbflowmanager-hyperion-library</artifactId>
  <version>1.0.4</version>
  <type>pom</type>
</dependency>

<dependency>
  <groupId>com.wajahatkarim3.dbflowmanager-hyperion-library</groupId>
  <artifactId>dbflowmanager-hyperion-library-no-op</artifactId>
  <version1.0.4</version>
  <type>pom</type>
</dependency>

Usage

Although, Hyperion will find the plugin automatically and add it to the list when you open the Hyperion drawer (as shown in the demo GIF above), but you need it tell the library about your database class. You can do it in your Application file after the DBFlow configuration is set like this:

public class MyApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        // DBFLow Configuration
        FlowManager.init(new FlowConfig.Builder(this).build());
        
        // ....
        // Other configs like Retrofit, Dagger modules, Picasso, etc.
        // ....
        
        // Hyperion DBFlowManager Plugin Setup
        DBFlowManager_Hyperion_Constants.setDatabaseName(getApplicationContext(), YOUR_APP_DB_FILE.class);
    }
}

Troubleshooting

If you get any crash about calling FlowManager.init() like this issue, then refer to this solution.

The key point here is that if you use kotlin for databases and tables, then use kapt for DBFlow annotation processings.

Libraries Used

Donations

This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated (and I love food, coffee and beer). Thank you!

PayPal

  • Donate $5: Thank's for creating this project, here's a tea (or some juice) for you!
  • Donate $10: Wow, I am stunned. Let me take you to the movies!
  • Donate $15: I really appreciate your work, let's grab some lunch!
  • Donate $25: That's some awesome stuff you did right there, dinner is on me!
  • Donate $50: I really really want to support this project, great job!
  • Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
  • Donate $2799: Go buddy, buy Macbook Pro for yourself!

Of course, you can also choose what you want to donate, all donations are awesome!

Developed By

Wajahat Karim

How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright 2018 Wajahat Karim

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

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

dbflowmanager-hyperion-plugin's People

Contributors

wajahatkarim3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

morristech

dbflowmanager-hyperion-plugin's Issues

Release APK not being generated.

There's no module for release builds. And release APKs don't get generated due to an error of Unresolved object: DBFlowManager_Hyperion_Constants etc.

Crashing when database and tables are in kotlin.

If database and table classes are in Java, then all works good. But if these classes are in kotlin, then I get this exception.

FATAL EXCEPTION: main                                                                                                                                                                                                                                                              
Process: tinkoff.androidcourse, PID: 2981                                                                                                                                                                                                                                          
java.lang.RuntimeException: Unable to start activity ComponentInfo{tinkoff.androidcourse/tinkoff.androidcourse.NavigationActivity}: java.lang.IllegalStateException: The global database holder is not initialized. Ensure you call FlowManager.init() before accessing the databas
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)                                                                                                                                                                                                  
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)                                                                                                                                                                                                   
    at android.app.ActivityThread.-wrap12(ActivityThread.java)                                                                                                                                                                                                                     
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)                                                                                                                                                                                                        
    at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                                                                                                                                                        
    at android.os.Looper.loop(Looper.java:154)                                                                                                                                                                                                                                     
    at android.app.ActivityThread.main(ActivityThread.java:6119)                                                                                                                                                                                                                   
    at java.lang.reflect.Method.invoke(Native Method)                                                                                                                                                                                                                              
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                                                                                                                                                                                             
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)                                                                                                                                                                                                                
 Caused by: java.lang.IllegalStateException: The global database holder is not initialized. Ensure you call FlowManager.init() before accessing the database.                                                                                                                      
    at a.b.a.a.b.f.c(Unknown Source)                                                                                                                                                                                                                                               
    at a.b.a.a.b.f.b(Unknown Source)                                                                                                                                                                                                                                               
    at a.b.a.a.b.f.i(Unknown Source)                                                                                                                                                                                                                                               
    at a.b.a.a.b.f.a(Unknown Source)                                                                                                                                                                                                                                               
    at a.b.a.a.f.a.e.f(Unknown Source)                                                                                                                                                                                                                                             
    at a.b.a.a.f.a.e.a(Unknown Source)                                                                                                                                                                                                                                             
    at a.b.a.a.f.a.a.b(Unknown Source)                                                                                                                                                                                                                                             
    at a.b.a.a.f.a.d.b(Unknown Source)                                                                                                                                                                                                                                             
    at tinkoff.androidcourse.e.b(Unknown Source)                                                                                                                                                                                                                                   
    at tinkoff.androidcourse.e.a(Unknown Source)                                                                                                                                                                                                                                   
    at android.support.v4.b.l.b(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.a(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.d(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.a(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.f.c(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.b(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.a(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.b(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.r.f(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.o.o(Unknown Source)                                                                                                                                                                                                                                    
    at android.support.v4.b.m.onStart(Unknown Source)                                                                                                                                                                                                                              
    at android.support.v7.app.e.onStart(Unknown Source)                                                                                                                                                                                                                            
    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)                                                                                                                                                                                                  
    at android.app.Activity.performStart(Activity.java:6696)                                                                                                                                                                                                                       
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)                                                                                                                                                                                                  
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)                                                                                                                                                                                                   
    at android.app.ActivityThread.-wrap12(ActivityThread.java)                                                                                                                                                                                                                     
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)                                                                                                                                                                                                        
    at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                                                                                                                                                        
    at android.os.Looper.loop(Looper.java:154)                                                                                                                                                                                                                                     
    at android.app.ActivityThread.main(ActivityThread.java:6119)                                                                                                                                                                                                                   
    at java.lang.reflect.Method.invoke(Native Method)                                                                                                                                                                                                                              
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                                                                                                                                                                                             
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)     

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.