[SERVER + mobile phone project] Database Design of Android + servlet + JSON comprehensive case study [1]

Source: Internet
Author: User

Preface:

First of all, I think this example is very simple. As an android engineer, it is necessary to understand or develop the server background, write some interfaces, and so on, because the technology changes very quickly, but they all have some commonalities, in the process of constantly learning the language, discover things that do not change, to improve yourself. Recently, I think PHP is quite simple. I will share it with you next time.

1. My design idea is probably like this,

General ideas:

View is the controls that can be used on the mobile phone end. After a trigger event is clicked, it is handed over to the Controller, requesting the server servlet. After the server receives the request, it can see what it is, then, obtain the corresponding value from the database and encapsulate it into an Entity Bean. Finally, convert the object to JSON format and return it to the client.

2. I did this thing about registration and login cases.

Step 1: Design the attributes of the database fields. First, set four fields:

Int ID varchar name varchar passwd varchar mail

User ID username User Password email

Here we use MySQL. First, we create a table in a database, that is, the statement used by the user to create this table is as follows:

CREATE TABLE IF NOT EXISTS `user` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `name` varchar(30) DEFAULT NULL,  `passwd` varchar(30) DEFAULT NULL,  `mail` varchar(50) DEFAULT NULL,  PRIMARY KEY (`id`)) 

After setting up, you can insert a data record for testing.

[Integrated development environment I used: xmapp, which is an open-source and very useful environment]

This is the case after creation.

Next, I began to design Java Web, namely Serlvet.

Related Article

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.