Activeandroid is an open-source database framework that makes it easier for us to use databases in Android, and today we'll look at the use of this database framework.1. Introduction of ActiveandroidFirst create our own project, in our project introduced Activeandroid, introduced activeandroid need us to modify two places, a global gradle file, there is a local g
From the Java Web to Android students should know SSH or SSI, used to hibernate or mybatis, to go to Android after the easy to find the ORM is not feel very uncomfortable. In fact, there are many Orm in Android. Activeandroid sugarorm Siminov Greendao ormlite androrm
This article mainly introduces the usage of activeandroid. Students who have used Litepal will find that the use of these two frameworks is so
difference is just the details of the process.If interested classmates, recommend reading the source code under Activeandroid. Reading the fucking code!Once wrote a series of articles introducing Xutils, the FINALDB module is an ORM framework, which is often used in my work. Today we introduced the Activeandroid API is quite simple and friendly. And the function of the same powerful.
, recommended reading under the activeandroid source. Reading the fucking code!
Previously wrote a series of articles about Xutils, the Finaldb module is an ORM framework, which is also used in my work. The Activeandroid API we are introducing today is also quite simple and friendly and powerful. Activeandroid Concise API gives people a feeling that it is comfor
In the previous chapter, we finished reading the Conguration class. Finally, we find that conguration is for the initialization of the database. It contains the memory size, database name, database version, parser information. Public Static synchronized voidInitialize (configuration configuration) {if(sisinitialized) {LOG.V ("Activeandroid already initialized."); return; } Scontext=Configuration.getcontext (); Smodelinfo=Newmodelinfo (configuration);
, recommend reading under the activeandroid source. Reading the fucking code!Previously wrote a series of articles introducing Xutils, of which the Finaldb module is an ORM framework, which is commonly used in my work. Today we introduced the Activeandroid API is quite simple and friendly, but also the same powerful features. Activeandroid Simple API gives people
Android ORM framework ActiveAndroid and ormactiveandroid1. In AndroidManifest. xml, we need to add these twoAA_DB_NAME (Database name, which cannot be changed, but is optional. If this parameter is left blank, the default value is "Application. db)
AA_DB_VERSION (the database version number is also optional-the default value is 1)
...
2. initialize In the first Activity or application
3. To create an object class, you must inherit from the Model.
Set in Androidmanifest Meta-data Android:name = "Aa_models" android:value= "Entity class for Full package name"/>Many are separated by commas, but this setting is not valid and is not known for a reason. So in the code, before initialize, add the database entity class.Configuration.builder config = new Configuration.builder (this); Config.addmodelclasses (Dbaccount.class, Dbplatform.class, Dbmessage.class, Dbpopquestion.class, Dbstudyrecord.class); Activeandroid.initialize (Config.create
() {return"userentity{" + "age=" + Age + ", username= '" + username + ' \ ' + '} '; }} Public class extends Application { @Override publicvoid onCreate () { super . OnCreate (); // initializing the database framework Activeandroid.initialize (this);} }/*** 1. Add dependencies * 2. Initialize Activeandroid * 3 in the Application class. Create an entity class that inherits from Model * 4. Create an instance of an entity
settings4) SQLite/data/data/packagename/databasesScenario: Large data volume, similar data structure, frequent increase/deletion/change/checkContacts, text messages, pictures, audio, video5) WebURLScenario: Users can view on any deviceCategory:1) Service side2) ClientReview:SQLite Use steps1) Inherit Sqliteopenhelper2) Create helper, helper.getwritabledatabase ()3) db.execsql (SQL)db.rawquery ()relational databaseObject Oriented4) ORM Object Relational MappingDb.insert ()Db.delete ()db.update (
. string. label_press_main, Toast. LENGTH_SHORT ). show (); mExitTime = System. currentTimeMillis ();} else {finish ();} return true;} else return super. onKeyDown (keyCode, event );}ActiveAndroid conflicts with Gson
Problem description:ActiveAndroid Model cannot be instantiated through Gson because ActiveAndroid Model contains fields that cannot be converted by Gson;
Solution:Filter the specified class in
effect, see the blog link.
SwipeRefreshLayout
SwipeRefreshLayout is a pull-down refresh component updated by Google in the support v4 19.1 library. It is easy to use and can easily implement the Google Now effect.Some open-source libraries required for Android Development
Speaking of open-source libraries, you have to mention GitHub. It can only be said that it is currently the most active open-source community. If you do not know how to register an account to use it, it is definitely a tool fo
understand this, you can participate in some open-source projects.Some open-source libraries required for Android Development
Speaking of open-source libraries, you have to mention GitHub. It can only be said that it is currently the most active open-source community. If you do not know how to register an account to use it, it is definitely a tool for you to quickly improve technology.Volley
In App development, it is inevitable to interact with the server. volley is an open-source network commu
to write a separate SQL statement. Each database record is wrapped neatly into a class of methods, such as Delete () and save ().Objects that extend the Activeandroid model can be stored in a database, such as:[JS]View Plaincopy
User.save ();
You can easily replace large SQL statements:[JS]View Plaincopy
INSERT into Users (nickname, Name, Address, City, PostalCode, country) VALUES (' Batman ',' Bruce W ',' Palisades 21 ',' Goth
operation of data than the Android native system SQLite
47.android-cleanarchitecture
Cleanarchitecture is a very typical use of the MVP architecture of the project, if you have not understood the MVP architecture can look at this project
Stickylistheaders.
Stickylistheaders is a ListView section header library that can be fixed at the top of the screen, that is, the header of the current section is fixed at the top of the screen, and when it slides to anoth
.ActiveAndroid
Activeandroid is a lightweight ORM architecture for the Android platform designed with the Active record architecture pattern in rails, enabling rapid development with virtually no SQL code to write
51.android-volley
Volley is a new network communication framework launched by Google's official development team in 2013 at the Google I/O Conference, a framework that comb
BlogSwiperefreshlayoutSwiperefreshlayout is a drop-down refresh component of Google's support V4 19.1 version of the library update, which is handy for Google Now's results.Some open source libraries that Android developers must knowWhen it comes to the open source Library, you have to mention GitHub, only to say that the most active open source community, do not know to quickly register an account to use, is definitely your fast technology to improve the weapon.VolleyWhile app development is i
more, such as Greendao, Ormlite, Activeandroid, Sugarorm, and so on, where Greendao runs most efficiently and consumes the least memory. Let's take a look at the specific usage of Greendao.
Second, download and unzip Greendao related resources
through the official website, you can obtain Greendao related resources, official website address:http://greendao-orm.com/ . Through the above address, the Greendao related resources
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.