Cordova (PHONEGAP) Simple application

Source: Internet
Author: User
Tags install node



I. Install node first



Two. Cordova Installation, build demo


?  ~ git:(master) ? sudo npm install -g cordova
Password:
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
[email protected] /usr/local/lib/node_modules/cordova
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
?  ~ git:(master) ? cd Desktop
?  Desktop git:(master) ? cordova create hello com.example.hello HelloWorld
Creating a new cordova project.
?  Desktop git:(master) ? cd hello
?  hello git:(master) ? cordova platforms add ios
Adding ios project...
Running command: /Users/goyoo/.cordova/lib/npm_cache/cordova-ios/3.9.2/package/bin/create /Users/goyoo/Desktop/hello/platforms/ios com.example.hello HelloWorld --cli
iOS project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-whitelist" for ios

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

?  hello git:(master) ? cordova platforms add android
Adding android project...
Running command: /Users/goyoo/.cordova/lib/npm_cache/cordova-android/4.1.1/package/bin/create /Users/goyoo/Desktop/hello/platforms/android com.example.hello HelloWorld --cli
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.example.hello
	Name: HelloWorld
	Activity: MainActivity
	Android target: android-22
Copying template files...
Android project created with [email protected]
Installing "cordova-plugin-whitelist" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.


Three. Build an iOS app with the FRAMEWORK7 framework



1. Build a Cordova Project


?  Tab-bar git: (Master)? Cordova Create appcreating a new Cordova project.


2. Delete the four files below App/www


    • CSS Folder
    • IMG Folder
    • JS folder
    • index.html file


3. Copy a H5 item to the App/www folder, open www/index.html add <script type="text/javascript" src=" Cordova.js "></script>



< Span class= "CRAYON-E" >    4.


?  app git:(master) ? cordova platforms add ios
Adding ios project...
Running command: /Users/goyoo/.cordova/lib/npm_cache/cordova-ios/3.9.2/package/bin/create /Users/goyoo/Downloads/Framework7-1.4.0/examples/tab-bar/app/platforms/ios io.cordova.hellocordova HelloCordova --cli
iOS project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-whitelist" for ios

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.


5. Into the Platforms/ios, you can open it with Xcode. Xcodeproj Project



6. H5 project, Ibid., index.html plus <script type="text/javascript" src="Cordova.js"> </script>





?  Desktop git:(master) ? cd app-ui-h5.git
?  app-ui-h5.git git:(master) ? cordova platforms add ios
Adding ios project...
Running command: /Users/goyoo/.cordova/lib/npm_cache/cordova-ios/3.9.2/package/bin/create /Users/goyoo/Desktop/app-ui-h5.git/platforms/ios com.xiaoyun.wdsj 旺店商家 --cli
iOS project created with [email protected]
Running command: /Users/goyoo/Desktop/app-ui-h5.git/hooks/after_prepare/010_add_platform_class.js /Users/goyoo/Desktop/app-ui-h5.git
add to body class: platform-ios
Installing "com.goyoo.report" for ios
Installing "com.ionic.keyboard" for ios
Notice: org.apache.cordova.camera has been automatically converted to cordova-plugin-camera and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-camera" via npm
cordova-plugin-camera" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.camera" being installed.
Installing "org.apache.cordova.camera" for ios
Notice: org.apache.cordova.console has been automatically converted to cordova-plugin-console and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-console" via npm
cordova-plugin-console" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.console" being installed.
Installing "org.apache.cordova.console" for ios
Notice: org.apache.cordova.device has been automatically converted to cordova-plugin-device and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-device" via npm
cordova-plugin-device" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.device" being installed.
Installing "org.apache.cordova.device" for ios
Notice: org.apache.cordova.file has been automatically converted to cordova-plugin-file and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-file" via npm
cordova-plugin-file" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.file" being installed.
Installing "org.apache.cordova.file" for ios
Notice: org.apache.cordova.file-transfer has been automatically converted to cordova-plugin-file-transfer and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-file-transfer" via npm
cordova-plugin-file-transfer" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.file-transfer" being installed.
Installing "org.apache.cordova.file-transfer" for ios
Notice: org.apache.cordova.file has been automatically converted to cordova-plugin-file and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-file" via npm
cordova-plugin-file" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.file" being installed.
Dependent plugin "org.apache.cordova.file" already installed on ios.
Notice: org.apache.cordova.geolocation has been automatically converted to cordova-plugin-geolocation and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-geolocation" via npm
-
/
|
|
cordova-plugin-geolocation" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.geolocation" being installed.
Installing "org.apache.cordova.geolocation" for ios
Notice: org.apache.cordova.network-information has been automatically converted to cordova-plugin-network-information and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-plugin-network-information" via npm
cordova-plugin-network-information" will not install due to "/Users/goyoo/Desktop/app-ui-h5.git/plugins/org.apache.cordova.network-information" being installed.
Installing "org.apache.cordova.network-information" for ios








Cordova (PHONEGAP) Simple application


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.