droitatedDB


Source link: https://github.com/arconsis/droitatedDB

#droitatedDB

The name

droitatedDB is a shortened version of Android annotated DB.

An droid anno tated DB

The result is droitatedDB

At a glance

droitatedDB is a lightweight framework, which frees you from the burden of dealing with the Android SQLite database directly if you don't want to but lets you access it directly if you need to.

With an annotation based approach you are able to get a database up and running in no time. Simply annotate your data classes and let droitatedDB do the work.

Features

  • Annotation based implementation
  • No hard coded Strings in your code
  • Code generation for the ceremonial tasks
  • Compile time protection when renaming fields or tables
  • Fall back to Android default API is always possible

Download

Add the android-apt plugin to your project-level build.gradle:

buildscript {

repositories {

  mavenCentral()
 
}

dependencies {

  classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

}
 
}

After that, apply inside your module-level build.gradle the android-apt plugin and add droitatedDB dependencies:

apply plugin: 'android-apt'  apt {

arguments {

  manifest variant.outputs[0]?.processResources?.manifestFile

}
 
}
  dependencies {

apt 'org.droitateddb:processor:0.1.9'
compile 'org.droitateddb:api:0.1.9' 
}

How do I use DroitatedDb?

For the full Tutorial check out our Wiki here: Tutorial
First we need to create our database:

@Update @Persistence(dbName = "my_database.db", dbVersion = 1) public class PersistenceConfig implements DbUpdate {

  @Override
  public void onUpdate(SQLiteDatabase db, int oldVersion, int newVersion) {

// here you can put your update code, when changing the database version
  
}
 
}

After that we can create our first entitiy:

@Entity public class User {

  @PrimaryKey
 @AutoIncrement
 @Column
 private Integer _id;
 @Column
 private String name;
public User() {

//droitatedDB needs an empty constructor  
}

  public User(String name) {

this.name = name;
 
}

  //... 
}

Now we can store data:

EntityService userService = new EntityService(context, User.class);
 userService.save(new User("Bob"));

And read data:

EntityService userService = new EntityService(context, User.class);
 List<User> allUsers = userService.get();

Documentation

Check out the documentation and introduction here

JavaDocs

Get into the API details reading the technical API

Release notes

Check out the release notes, to see what's new in droitatedDB

Resources

Easy splash screen library allows you to generate beautiful and customizable Splash screens with less effort.

A library that allows you to enable/disable features and/or part of code regarding a Context.

Adapter library for RecyclerView to display your app's OSS dependencies.

Estimates the size of a Google Play patch and the new gzipped APK.

Custom animation for Google Speech Recognizer.

Android DialogFragment that enables Dialog to be swiped away to dismiss.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes