Database Operations for Mobile front-end development, front-end databases

Source: Internet
Author: User

Database Operations for Mobile front-end development, front-end databases
Database Operations for Mobile front-end development

In mobile platform development, there are often big data storage and interaction operations. A database called WEBSQL is provided in a webkit-based browser. This allows the front-end to perform database read and write operations like php and other programming languages. Currently, the Web Storage method for storing local data can be implemented on many mainstream browsers, platforms, and devices, and related APIs have been standardized. However, the Web Storage space is 5 MB, the key-value storage method brings a lot of inconvenience. In the future, local storage is not just this method. The most well-known among them is the Web SQL database, which has built-in SQLite database. database operations can be achieved by calling the executeSql () method, allowing the use of JavaScript code to control the database. In this way, the front-end application has a broader sky.

  Open and create a databaseTo store local data through WebDb, you first need to open or create a database. The API for opening or creating a database is openDatabase. The called code is as follows: openDatabase (DbName, DBVersion, DBDescribe, DBSize, Callback (); the parameters indicate the database name, version number, description, database size (in bytes), and the Callback function executed after creation or opening is successful.

The following three methods are used:

1. openDatabase: This method uses an existing database or a new database to create database objects.

2. transaction: This method allows us to control transaction commit or rollback as needed.

3. executeSql: This method is used to execute real SQL queries.

The following is an example.
<! DOCTYPE html> 

The above code is saved as an html file. on Google's browser, open the console and you can see the running result.

Limitations:
Unfortunately, I tested the Firefox browser that programmers like most. Unfortunately, it does not support this local database SQLite and may be replaced by indexDB.

Additional reading: http://www.2cto.com/kf/201205/130762.html


Is front-end development web development, including database links and some operations? Or pure html Web Front-end development: mainly through html/css, js, ajax, DOM and other front-end technologies, to achieve the correct display and interaction functions of the website on the customer service end. It can be divided into: web page reconstruction and js function development. With the advent of HTML5, the RIA era is being opened, and the web front-end application functions will be more flexible. The biggest benefit is that it can achieve a more friendly user experience on the customer service end without imposing a heavy burden on the server.
All of the above are based on personal understanding.
I want to develop mobile front-end web pages. Do you have any recommended learning books? Mobile applications include web apps and native apps.

Similar to web development, web apps use html + css + js and require development platforms such as PhoneGap. The books in this regard include PhoneGap Development Guide and PhoneGap.
The native app is an android or iphone platform.
Android requires a java Foundation. You can refer to "crazy Android handouts", "android Application Development secrets", and "Android programming typical examples and project development ".
Iphone requires Objective-C basics. The video titled Objective-C, Objective-C Programming (Fourth Edition), Stanford: iphone development tutorial is also good.

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.