Combined with the previous ormlite and Hessian, plus the SAE has supported Java, the server to switch to Java, there is this article. Using Hessian to do data transfer, the ormlite is used to realize the storage of the client and server, which greatly reduces the crud work. This article for exploration stickers, not formally used for large-scale projects, welcome to discuss the use of!
First, Introduction
1.1ormlite
Ormlite[object Relational Mapping Lite (ORM Lite)]
The Object Relational Mapping Compact (ORM) provides some simple, lightweight, and persistent Java objects to SQL databases, while avoiding complexity and the overhead of more standard ORM packages.
The JDBC call to support the database, of course, is certainly the most important thing it supports the Android native database API call SQLite.
--reprinted from here.
1.2hessian
Use the method reference this Bo two articles:
[Hessdroid] Android uses Hessian to communicate with Java server
[Hessdroid] The pass-through test using Hessian and Java server-side communication under Android
1.3Android Rapid Development Framework Description
Consider some of the following features:
A). Both client (Android) and server use the Java language
B. Both client (Android) and server support Hessian and ormlite frameworks
c). Complete support for object-oriented development: storage and interactive transport
Second, prepare
2.1 Development environment
To facilitate the development of both the Android and the Java Web, this is a version of the Eclipse IDE for Java EE Developers, and then installs the latest ADT Plug-ins and Tomcat Plug-ins.
2.2 Service Side
The application server uses Tomcat, which uses Java (Jsp/servlet) to implement the service-side business logic, and the database uses MySQL. Quick Frame Build recommend everyone use XAMPP (integrated Apache, MySQL, PHP, etc., support green installation).
2.3 Client
The Common Android environment
2.4 Communication and storage instructions
Server-side and the client through the Hessian data exchange, through the Ormlite to save the database (through JDBC saved to the server side of the MySQL database, can also be directly saved to the client's SQLite database);
Third, the Code
3.1 Project Engineering screenshot (service side)
Holib is used for both client and server to ensure consistency of interfaces and data objects.