"android"greendao

Source: Internet
Author: User

version: Greendao 3.2.2 official website: Http://greenrobot.org/greendao/GitHub:https://github.com/greenrobot/greenDAO
written in front: This library greatly optimizes our use of the SQLite database, but the SQLite database and its syntax is still in our hands, it is not recommended for beginners to use this without the use of Android native database API.
Introduction:Greendao is an open-source Android-oriented lightweight, fast ORM framework, to map Java objects to the SQLite database, when we operate the database, do not need to write complex SQL statements, in terms of performance, gree The Ndao is highly optimized for Android, with minimal memory overhead, small dependent volume, and database encryption support. Excerpt from: http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2017/0703/8144.html
What is ORM? Object Affinity Mapping (English: Object Relational Mapping, abbreviated ORM, or O/RM, or O/R Mapping) is a programming technique that enables the conversion of data between different types of systems in an object-oriented programming language. Excerpt from: Wikipedia https://zh.wikipedia.org/zh-sg/%E5%AF%B9%E8%B1%A1%E5%85%B3%E7%B3%BB%E6%98%A0%E5%B0%84
It is characterized by:
  • The highest performance (probably the fastest Android ORM), we are also open source
  • Easy to use
  • Minimal memory consumption
  • A small library (<100KB) allows you to spend less time building and avoid the limitations of 65k methods
  • Database encryption: Greendao supports sqlcipher to keep your users ' data safe
  • Powerful community: More than 5000 of GitHub stars demonstrate that this is a strong and active community
what is Sqlcipher? Android SQLite does not support data encryption, so that the user's data is not secure (many phones are root, it can be directly into the/data/data/<package_name>/ Databases directory below), so, we need to encrypt it, one is to encrypt the content (but the structure of the database can be a glance, and then the encryption after the search is a problem), one is directly to the SQLite database encryption,    Directly encrypt the database file will use the Sqlcipher, it is one of the encryption tools, it is free, the others are more charges. SQLCipher, fully open source, hosted on GitHub (Https://github.com/sqlcipher/sqlcipher). Reference: http://foggry.com/blog/2014/05/19/jia-mi-ni-de-sqlite/Study Use article recommendation: http://blog.csdn.net/guolin_blog/article/ details/11952409
who's using Greendao? Many of the top Android apps rely on Greendao, some of which already have more than 10 million installs, and we believe this proves its reliability in the industry. You can view the current statistics in Appbrain. Appbrain:http://www.appbrain.com/stats/libraries/details/greendao/greendao
Let's start using it.

Configure Gradle First

// In your root build.gradle file:buildscript {    repositories {    jcenter()    mavenCentral() // add repository}dependencies {    classpath ‘com.android.tools.build:gradle:2.3.3‘    classpath ‘org.greenrobot:greendao-gradle-plugin:3.2.2‘ // add plugin}}// In your app projects build.gradle file:apply plugin: ‘com.android.application‘apply plugin: ‘org.greenrobot.greendao‘ // apply plugindependencies {    compile ‘org.greenrobot:greendao:3.2.2‘ // add library}

Perhaps you can look at the official example first: daoexample:https://github.com/greenrobot/greendao/tree/master/examples/ Daoexamplerxdaoexample (Async): Https://github.com/greenrobot/greenDAO/tree/master/examples/RxDaoExample Next:

Chinese translation, this is the link

"android"greendao

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.