Node version Management NVM installation process
Because the latest version of node is not compatible with some features, it is necessary to install NVM switch node version
Download Nvm-windows in Https://github.com/coreybutler/nvm-windows
After installation, because the download node speed is too slow, so modify the installation directory Setting.txt file, plus:
Arch:64
Proxy:none
node_mirror:http://npm.taobao.org/mirrors/node/
npm_mirror:https://npm.taobao.org/mirrors/npm/
Then install the required version
NVM Install latest//last version
NVM Install 6.9//Node 6.9
After installation
NVM Use 6.9
Then check to see if the installation was successful
Node-v
If an error occurs, delete the Nodejs folder that was created when you installed the NVM
Routine installation CNPM
NPM install-g cnpm--registry=https://registry.npm.taobao.org
Cordova installation Process
First global installation of Cordova and PHONEGAP (not installed)
CNPM Install Cordova Phonegap-g
Then create a working directory based on the template
Cordova Create app (folder name) Com.example.app app (app name)--template
CD app
CNPM Install//installation dependent
Cordova Platform Add Android//install Android platform
Cordova Plugin Add Cordova-plugin-camera//Camera API
Cordova Requirements//view the running environment and discover the missing SDK
Java SDK, Android SDK, Gradle installation and configuration environment variables
Installing the Java SDK
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Installing the Android SDK
Https://android-sdk.cn.uptodown.com/windows
Decompression Gradle
Https://gradle.org/releases
Adding environment variables
Java_home D:\java (Java SDK installation location)
CLASSPATH%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
Gradle_home D:\gradle-3.3 (GRADLE mounting position)
Path
%android_home%\platform-tools
%android_home%\tools
%java_home%\bin
%gradle_home%\bin
User Environment variables:
Under the PATH variable:
The Android SDK installs the following files
Configure Simulator ADV
Debugging
Enable ADV debugging while packaging the APK into the app\platforms\android\build\outputs\apk directory
Cordova Run Android
When calling the native API, add the following label to the index.html (the file is in the App\platforms\android\assets\www directory)
<script type= "Text/javascript" src= "Cordova.js" ></script>
Hybrid app (Cordova) environment configuration record