ArticleDirectory
- 2.1.1 select Platform
- 2.1.2 environment requirements and Installation
- 2.1.3 setup Project
Chapter 1 Introduction to phonegap 1.1 What is phonegap
Phonegap is a free and open source development tool and framework that allows the use of the powerful functions of HTML + JavaScript + CSS to be developed on multiple mobile platforms.ProgramThe developed programs are compiled on their respective platforms to form independent installation programs. Make the program look the same as the native program.
1.2 Advantages and Disadvantages of phonegap
Advantages:
L cross-platform: one development, multiple platforms sharing. It mainly includes Android, IOS, Apple iOS, Google Android, palm, Symbian, and blackberry. WP7 and other platforms are gradually compatible.
L lower the development threshold. For many web developers, it is quite painful to be familiar with objective-C language and Java language. With phonegap, you don't have to worry about this. With familiar Web Front-end technology, you can develop very professional mobile phone applications.
L provides powerful hardware access control. Compared with traditional web programs, phonegap provides JS classes with some columns, allowing you to directly access hardware. For example, acceleration, cameras, compass, GPS, and file access allow you to use js to conveniently call system hardware. To make up for a piece of errors in traditional web programs.
L easy installation and use. The architecture of phonegap is very complex, but for most developers, the environment can be set up with simple configuration. You only need to focus on writing your own web pages and copy them in.
Disadvantages:
L slow running speed: The program loading and UI interface response are slower than the native program because it is still displaying web pages, therefore, loading and page refreshing must take some time.
L not suitable for some programs. If your program requires 3D functions or has high requirements for interface refresh, it is better to use native languages.
1.3 Basic phonegap development knowledge
L HTML: as the most basic web development, HTML knowledge is essential. Now many mobile terminals support HTML5, so it is best to learn HTML5-related knowledge;
L CSS: defines the page style and so on. Without CSS, it is difficult to control the positioning and style of your page. It is recommended that you have knowledge about css3 and write a better interface;
L javascript: Background interaction is implemented by JavaScript, read and write databases, and load data into Google map;
L phonegap Class Library: Are JavaScript library, use is very simple, there are detailed documents, can refer to the official website: http://docs.phonegap.com/
L basic platform knowledge: for example, to create an iPhone program, you must know how to install xcode, how to compile it, how to obtain the authorization certificate, and how to debug the real machine, to create an android program, you must build an ecllipse development environment. Will be simple to use these platforms, you can install the phonegap platform, you can refer to: http://www.phonegap.com/start
1.4 powerful assistant of phonegap
Developing a phonegap program, jquery mobile is not a must, but with jquery mobile, it can make your program more beautiful.
Jquery mobile is actually a bunch of style sets and Java events. For example, if you write a button, iOS and Android are different. html is often ugly. The general processing method is to redefine the button style to make it more like the button on the mobile phone platform. Jquery Mobile provides you with this framework. You can use simple attribute settings to make buttons similar to getting off the mobile platform, which is quite convenient.
For details, see: http://jquerymobile.com/
You can also use sencha touch, which is also a good choice.
For details, see: http://www.sencha.com/
Chapter 2 Quick Start 2.1 Quick Start
The official tutorial is:
Http://phonegap.com/start#android
Here is a simple translation.
2.1.1 select Platform
I chose android.
You can also directly watch videos.
2.1.2 environment requirements and Installation
Eclipse 3.4 +
Download and install eclipse classic
Download and install Android SDK
Download and install ADT plugin
Download the latest copy of phonegap and extract its contents. We will be working with the android directory.
The above three are the basic environment of Android, and the following are the SDK packages required by phonegap.
2.1.3 setup Project
Create an android project and select