Greendao Introduction:Greendao is an Object relational mapping (ORM) framework that provides an interface to manipulate relational databases by manipulating objects, which makes it easier and easier for you to manipulate the database. As shown in the following illustration:
Website address: http://greenrobot.org/greendao/
Github:https://github.com/greenrobot/greendao
Greendao Advantages:
High performance, known as
Don't say anything, directly on the code. If you can not understand the following and I leave a message.
First look at the service side: the use of PHP language, deployed in the Sina SAE server (with the database)
Put all the PHP files in the same directory:
1.db.php encapsulated classes for connecting to a database
2.response.php used to encapsulate communication data (JSON or XML)
3.checkl
Don't say anything, directly on the code. If you do not understand the following and I leave a message.First look at the server: using the PHP language, deployed in the Sina SAE servers (with the database)Place all of your PHP files in the same directory:1.db.php packaged classes for connecting to a database2.response.php for encapsulating Communication data (JSON or XML)3.checklogin.php is provided to the client, letting the client use GET request, i
We will use TodoList as an example to introduce the basic usage of SQLite. We have several suggestions when designing the SQLite database table:
It is not recommended that some file resources (such as files or sounds) be directly stored in database tables. Currently, the file names corresponding to these resources are stored or the full URL name used by the content provider.Although it is not mandatory, whe
This series is the "first line of Android Code" Learning notes, if there are errors and omissions, please correct me!Android in order to make it easier for us to manage the database, we specifically provide a Sqliteopenhelper helper class, which allows us to easily create and upgrade the database. First, since Sqliteop
This example describes the usage of database transactions in Android development. Share to everyone for your reference, specific as follows:
In the development of Android applications, transaction processing is very important when using a database.
First, Android
Use Android-Debug-Database to view the App Database in the browser.
Usage reference:Http://www.jianshu.com/p/89ccae3e590bSource Code address:Https://github.com/amitshekhariitbhu/Android-Debug-DatabaseFeatures:
Add dependency:Add the following code in your build. gradle:1 debugCompile 'com. amitshekhar.
Android Packaging installation to join the external database, I have this requirement so I wrote the following code, now share to everyone
Copy Code code as follows:
public void CreateDatabase () {
Try
{
Get the absolute path to the. db file
String databasefilename = Database_path + database_filename;
File dir = new file (rootdirectory);
If the directory does not exist, create this direct
Android provides a class named SQLiteDatabase, which encapsulates APIs for database operations. This class can be used to Create, query, and Update data) and Delete operations (CRUD ). For SQLiteDatabase learning, we should master the execSQL () and rawQuery () methods. The execSQL () method can be used to execute SQL statements with changing behaviors such as insert, delete, update, and CREATE TABLE. The r
For details, refer to the Development notes of an Android tablet project-scheduled task backup
Create a class to inherit from asynctask
Public class backuptask extends asynctask // Obtain the path of the database in use. My path is/dlion/db_dlion.db under the sdcard directory.// The default path is/data/(package name)/databases /*. DB file dbfile = mcontext. getdatabasepath (environment. getexternalstoraged
SQLite database storage: SQLite is a lightweight relational database, it is very fast operation, the use of small resources, usually only need hundreds of K of memory is sufficient, and therefore particularly suitable for mobile devices.First:Create a database. (Android is designed to make it easier for us to manage da
Transferred from http://www.bangchui.org/read.php?tid=7792
Android can use SQLite data pants to store data, but Google does not directly provide us with the tools to manage the data in the database.If you can't view it directly from the tool, we'll copy the database from the phone/emulator and use the tools to view it, and here's the steps1. Confirm the location of the databaseWe can access part of the p
building an instance of Sqliteopenhelper, call its getreadabledatabase () or getwritabledatabase () to create the database.egCreate a database named Mydatabase.db, creating a new user table with the ID (primary key) and the Name,password property.The CREATE TABLE statement for the user table is as follows:CREATE TABLE user{ID Integer PRIMARY KEY AUTOINCREMENT,//INTEGR: Shaping PRIMARY key: Primary key, Unique key autoincrement: self-growthName Text,/
When beginners are learning Android, it's a bit complicated to see how SQLite database programming is on the books.
The difficulty of the beginner stage:
Set Up Database table field (field) data type (text,interge) Select more, consider more.
Data update inserts in activity have a lot of constraints to consider
It's a bit cumbersome to always have access to t
' there is only a, B and C indexes that are valid, and the index of the D column is invalidated because it is on the right side of column C, and the C column uses inequalities, depending on the constraints of the use inequalities , column C already belongs to the far right. Finally, look at one more article: ... WHERE b in (All-inclusive) and C not NULL and d= ' Hello ' index will not be used because the leading column is not used, this query will be a full table query. Create the following tab
). this method will not be called if you 've changed your code and relaunched in the emulator. if you want oncreate () to run you need to use ADB to delete the SQLite database file. the sqlite3 tool description has more context here.
Database upgrading
The constructor of your Implementation of sqliteopenhelper shoshould call the super constructor, passing along
More content Welcome to my personal website: www.qingshuimonk.com viewSQLite is a lightweight relational database that currently supports five types of null,integer,real (floating point), text (string literal), BLOB (binary text).The created database file is located in the/data/data/package-name/databases directory.Files can be accessed through the File Explorer in Eclipse.Steps for the SQLite
First_database_version, which is the first database version size Final intfirst_database_version = 1000; Onupgrade (Sqlitedatabase, first_database_version, database_version); } @Override Public voidOnupgrade (Sqlitedatabase sqlitedatabase,intOldversion,intnewversion) { //upgrading databases across versions using for for(inti = oldversion; i ) { Switch(i) { Case1000:
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.