\u514d\u8d39wap\u7f51\u7ad9\u4e00\u952e\u751f\u6210app<\/a>b\u89c6\u56fe\u7684APP\u3002\u8fd9\u79cdAPP\u901a\u5e38\u79f0\u4e3aWebApp\u6216Hybrid App\u3002\u501f\u52a9\u4e00\u4e9b\u6846\u67b6\u548c\u5de5\u5177\uff0c\u5982Apache Cordova\u3001PhoneGap\u7b49\uff0c\u53ef\u4ee5\u5feb\u901f\u5c06PHP\u7f51\u7ad9\u6253\u5305\u6210APP\uff0c\u5e76\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\u63d0\u4f9b\u7684\u539f\u751fAPI\u8bbf\u95ee\u8bbe\u5907\u7684\u529f\u80fd\uff0c\u5982\u6444\u50cf\u5934\u3001GPS\u7b49\u3002<\/p>\n2. \u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n
\u6b65\u9aa4\u4e00\uff1a\u5c06PHP\u7f51\u7ad9\u5e94\u7528\u8f6c\u5316\u4e3a\u79fb\u52a8\u7aef\u9002\u914d\u7684\u9759\u6001\u7f51\u7ad9<\/p>\n
\u4f60\u9700\u8981\u5c06\u5df2\u7ecf\u5f00\u53d1\u597d\u7684PHP\u7f51\u7ad9\u5e94\u7528\u8fdb\u884c\u79fb\u52a8\u7aef\u9002\u914d\uff0c\u4fdd\u8bc1\u7f51\u7ad9\u5728\u4e0d\u540c\u5206\u8fa8\u7387\u548c\u5c4f\u5e55\u5c3a\u5bf8\u7684\u8bbe\u5907\u4e0a\u5177\u6709\u826f\u597d\u7684\u754c\u9762\u5c55\u793a\u6548\u679c\u3002\u53ef\u4ee5\u4f7f\u7528Bootstrap\u7b49\u6210\u719f\u7684\u524d\u7aef\u6846\u67b6\u8fdb\u884c\u79fb\u52a8\u7aef\u9002\u914d\u3002<\/p>\n
\u6b65\u9aa4\u4e8c\uff1a\u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee<\/p>\n
1. \u5b89\u88c5Node.js\u548cnpm\u3002\u8bf7\u8bbf\u95eeNode.js\u5b98\u7f51\uff08https:\/\/nodejs.org\/\uff09\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u5b8c\u6210\u5b89\u88c5\u3002\u5b8c\u6210\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n
“`<\/p>\n
node -v<\/p>\n
npm -v<\/p>\n
“`<\/p>\n
2. \u5b89\u88c5Cordova\u3002\u6253\u5f00\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n
“`<\/p>\n
npm install -g cordova<\/p>\n
“`<\/p>\n
3. \u521b\u5efaCordova\u9879\u76ee\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06\u66ff\u6362\u4e3a\u4f60\u7684\u5e94\u7528\u540d\u79f0\uff0c\u66ff\u6362\u4e3a\u4f60\u7684\u5e94\u7528ID\uff08\u901a\u5e38\u662f\u4e00\u4e2a\u9006\u5411\u57df\u540d\uff0c\u5982com.example.app\uff09\uff1a<\/p>\n
“`<\/p>\n
cordova create <\/p>\n
“`<\/p>\n
\u6b65\u9aa4\u4e09\uff1a\u5c06\u9002\u914d\u597d\u7684\u7f51\u7ad9\u6dfb\u52a0\u5230Cordova\u9879\u76ee\u4e2d<\/p>\n
1. \u5728Cordova\u9879\u76ee\u7684www\u6587\u4ef6\u5939\u4e2d\u5220\u9664\u9ed8\u8ba4\u7684index.html\uff0c\u628a\u5df2\u7ecf\u9002\u914d\u597d\u7684\u79fb\u52a8\u7f51\u7ad9\u590d\u5236\u5230\u6b64\u6587\u4ef6\u5939\u5185\u3002<\/p>\n
2. \u4fee\u6539www\u6587\u4ef6\u5939\u4e0b\u7684config.xml\u6587\u4ef6\uff0c\u6dfb\u52a0\u76f8\u5e94\u7684\u5e94\u7528\u4fe1\u606f\uff0c\u5982\u5e94\u7528\u540d\u79f0\u3001\u5e94\u7528\u63cf\u8ff0\u3001\u5e94\u7528\u4f5c\u8005\u7b49\u3002<\/p>\n
\u6b65\u9aa4\u56db\uff1a\u6dfb\u52a0\u5e73\u53f0\u548c\u63d2\u4ef6<\/p>\n
1. \u5728\u547d\u4ee4\u884c\u4e2d\u6253\u5f00Cordova\u9879\u76ee\u7684\u6839\u76ee\u5f55\uff0c\u6dfb\u52a0\u6240\u9700\u8981\u7684\u5e73\u53f0\uff08\u5982Android\u6216iOS\uff09\u3002\u4ee5\u6dfb\u52a0Android\u5e73\u53f0\u4e3a\u4f8b\uff1a<\/p>\n
“`<\/p>\n
cordova platform add android<\/p>\n
“`<\/p>\n
2. \u6dfb\u52a0\u6240\u9700\u7684\u8bbe\u5907\u529f\u80fd\u63d2\u4ef6\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u5e94\u7528\u9700\u8981\u4f7f\u7528\u6444\u50cf\u5934\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0Camera\u63d2\u4ef6\uff1a<\/p>\n
“`<\/p>\n
cordova plugin add cordova-plugin-camera<\/p>\n
“`<\/p>\n
\u6b65\u9aa4\u4e94\uff1a\u7f16\u8bd1\u548c\u8fd0\u884cAPP<\/p>\n
1. \u7f16\u8bd1APP\u3002\u4f8b\u5982\uff0c\u7f16\u8bd1\u4e3aAndroid\u5e94\u7528\uff1a<\/p>\n
“`<\/p>\n
cordova build android<\/p>\n
“`<\/p>\n
2. \u8fd0\u884cAPP\u3002\u5c06\u751f\u6210\u7684APK\u6587\u4ef6\u5b89\u88c5\u5230\u4f60\u7684Android\u8bbe\u5907\u4e0a\uff0c\u6216\u4f7f\u7528\u6a21\u62df\u5668\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n
“`<\/p>\n
cordova run android<\/p>\n
“`<\/p>\n
\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u7f51\u9875\u751f\u6210app\u7684\u5b89\u5353\u8f6f\u4ef6<\/a>\uff0c\u4f60\u53ef\u4ee5\u5c06PHP\u7f51\u7ad9\u8f6c\u6362\u4e3a\u4e00\u4e2aAPP\uff0c\u751f\u6210\u539f\u751f\u5e94\u7528\u5b89\u88c5\u5305\u3002\u7136\u540e\u53ef\u4ee5\u5c06\u5b89\u88c5\u5305\u5206\u53d1\u5230\u5404\u5927\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u53d1\u5e03\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8ePHP\u662f\u670d\u52a1\u5668\u7aef<\/p>\n
<\/figure>\n<\/p>\n\u811a\u672c\u8bed\u8a00\uff0c\u56e0\u6b64\u8fd9\u79cd\u65b9\u6cd5\u5b9e\u9645\u4e0a\u662f\u5c06PHP\u7f51\u7ad9\u6253\u5305\u6210\u4e00\u4e2a\u539f\u751f\u7ec8\u7aefAPP\uff0c\u5b9e\u73b0\u6838\u5fc3\u529f\u80fd\u548c\u8bbe\u5907\u529f\u80fd\u8bbf\u95ee\u7684\u903b\u8f91\u4ecd\u7136\u9700\u8981\u7f16\u5199\u5bf9\u5e94\u7684\u524d\u7aefJS\u4ee3\u7801\u548c\u540e\u7aefPHP\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
PHP\u751f\u6210APP\uff08\u539f\u7406\u53ca\u8be6\u7ec6\u4ecb\u7ecd\uff09PHP\u4f5c\u4e3a\u4e00\u95e8\u5f3a\u5927\u7684\u670d\u52a1\u5668\u811a\u672c\u8bed\u8a00\uff0c\u901a\u5e38\u7528\u4e8e\u7f51\u7ad9\u5f00\u53d1\uff0c\u800cAPP\u662f\u4e00\u79cd\u8f6f\u4ef6\u5e94\u7528\uff0c\u901a\u5e38\u8fd0\u884c\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5229\u7528PHP\u8bed\u8a00\u751f\u6210APP\u7684\u539f\u7406\u53ca\u8be6\u7ec6\u6b65\u9aa4\u30021. \u539f<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[4786,1888,4785,797,247],"topic":[],"class_list":{"0":"post-2273","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-appkf","7":"tag-app","8":"tag-1888","10":"tag-797","11":"tag-247"},"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=2273"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2273\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=2273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=2273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=2273"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=2273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}