First, build the Android environment
Each step to configure the environment variables, Baidu can do it by itself.
Step One: Install Nodejs
Refer to http://blog.csdn.net/u010255310/article/details/52205132
Step Two: Install the Java JDK
Step three: Install the Android SDK
Android Studio Download: https://developer.android.com/studio/index.html
Click Install, the official website has specific installation steps.
Step four: Install Apache Ant
No installation required, just add the path to the environment variable.
Apache Ant, a tool for automating software compilation, testing, deployment, and more, is mostly used for software development in Java environments. Provided by the Apache Software Foundation.
Step five: Install Cordova using the NPM command
Cordova provides a set of device-related APIs that enable mobile apps to access native device features, such as cameras, microphones, and so on, with JavaScript. Cordova also provides a unified set of JavaScript class libraries, as well as native background code related to the devices used by these class libraries.
Install -G Cordova
Step Six: Install Gradle
After 6.4.0 (cordova-android in 6.1.2), Cordova will ask to install Gradle, build and pack Android based on Gradle.
Gradle is a JVM-based build tool that provides:
- Like Ant, General-purpose, flexible build tools
- A contract-based build framework that can be switched
- Powerful multi-engineering build support
- Strong dependency management based on Apache Ivy
- Support Maven, Ivy Warehouse
- Supports transitive dependency management without the need for a remote repository or a pom.xml and ivy.xml configuration file.
- A good integration of Ant's mission
- Using groovy to write based on Groovy,build scripts
- There is a wide range of domain models to support construction
Download: gradle:https://gradle.org/releases
Installation: http://blog.csdn.net/maosidiaoxian/article/details/40109337
Step Seven: Set up the Android emulator
Create an Android emulator from the AVD (Android Virtual Device) Manager.
Convert Web page to Android APP
Step One: Create a project
Step Two: Import the Web program
In the first step, I created the Android project named Buysweat under Directory D:\AndroidStudio\, put the page I wrote in the D:\AndroidStudio\BuySweat\www directory, and the first name must be index.h Tml
Step three: Create an app
Cordova Build
A bug has occurred
D:\androidstudio\buysweat>Cordova Buildandroid_home=D:\AndroidStudio\SDKJAVA_HOME=D:\javaSubproject path:cordovalibstarting A Gradle Daemon,1Stopped Daemon could not being reused, use--status forDetailsfailure:build failed with an exception.*What went wrong:unable to start the daemon process. This problem might is caused by incorrect configuration of the daemon. For example, a unrecognized JVM option is used. Refer to the User Guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/Gradle_daemon.htmlplease Read the following process output toFindOut More:-----------------------Error occurred during initialization of Vmcould not reserve enough space for2097152KBObjectHeap*Try:run with--stacktrace option to get the stack trace. Run with--InfoOr--debugoption to get Morelog output. Error:cmd:Command failed with exit code1Error Output:FAILURE:Build failed with an exception.*What went wrong:unable to start the daemon process. This problem might is caused by incorrect configuration of the daemon. For example, a unrecognized JVM option is used. Refer to the User Guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/Gradle_daemon.htmlplease Read the following process output toFindOut More:-----------------------Error occurred during initialization of Vmcould not reserve enough space for2097152KBObjectHeap*Try:run with--stacktrace option to get the stack trace. Run with--InfoOr--debugoption to get MoreLog output.
Workaround:
Https://stackoverflow.com/questions/20471311/android-studio-unable-to-start-the-daemon-process
Finally in the platform/android/ant-build/buysweat-dubug.apk generated, sent to the phone can be used.
Html5+css3+jquery Mobile Structure Simple WebApp