{"id":1473,"date":"2023-07-31T18:40:09","date_gmt":"2023-07-31T10:40:09","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=1473"},"modified":"2023-07-31T18:40:09","modified_gmt":"2023-07-31T10:40:09","slug":"html%e5%bf%ab%e9%80%9f%e7%94%9f%e6%88%90app%e6%9c%89%e5%93%aa%e4%ba%9b%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/1473\/","title":{"rendered":"html\u5feb\u901f\u751f\u6210app\u6709\u54ea\u4e9b\u6b65\u9aa4?"},"content":{"rendered":"

\u4f7f\u7528HTML\u5feb\u901f\u751f\u6210APP\u7684\u65b9\u6cd5\u4e3b\u8981\u662f\u901a\u8fc7\u5c06\u7f51\u9875\u5e94\u7528\uff08Web App\uff09\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\uff08Native App\uff09\u5b9e\u73b0\u3002\u8fd9\u79cd\u65b9\u6cd5\u517c\u5177\u4e86\u7f51\u9875\u5e94\u7528\u7684\u4fbf\u6377\u5f00\u53d1\u53ca\u8de8\u5e73\u53f0\u7279\u70b9\uff0c\u4ee5\u53ca\u539f\u751f\u5e94\u7528\u7684\u4f18\u5f71\u89c6\u7f51\u7ad9app\u5728\u7ebf\u751f\u6210<\/a>\u70b9\uff0c\u5982\u4f4e\u6210\u672c\u3001\u5feb\u901f\u5f00\u53d1\u3001\u90e8\u7f72\u7b80\u5355\u7b49\u3002\u76ee\u524d\uff0c\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0HTML\u5feb\u901f\u751f\u6210APP\uff1a\u4f7f\u7528WebView\u6280\u672f\u6216\u57fa\u4e8ePhoneGap\/Cordova\u6280\u672f\u8fdb\u884c\u6df7\u5408\u5f0f\u5f00\u53d1\u3002<\/p>\n

\u4e00\u3001WebView\u6280\u672f<\/p>\n

WebView\u662f\u4e00\u4e2a\u5185\u7f6e\u4e8e\u539f\u751fAPP\u4e2d\u7684\u6d4f\u89c8\u5668\u63a7\u4ef6\uff0c\u53ef\u4ee5\u7528\u6765\u52a0\u8f7d\u5e76\u5448\u73b0HTML\u548cJavaScript\u7b49\u7f51\u9875\u5185\u5bb9\u3002\u4f7f\u7528WebView\u5f00\u53d1APP\u7684\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n

1. \u8bbe\u8ba1\u5e76\u7f16\u5199HTML\u9875\u9762\uff1a\u9996\u5148\u9700\u8981\u5236\u4f5c\u597d\u9002\u7528\u4e8e\u79fb\u52a8\u7aef\u7684\u7f51\u9875\u5e94\u7528\uff0c\u5305\u62ecHTML\u3001CSS\u3001JS\u3001\u56fe\u7247\u7b49\u6587\u4ef6\uff0c\u786e\u4fdd\u5176\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884c\u826f\u597d\u3002<\/p>\n

2. \u521b\u5efa\u539f\u751fAPP\u9879\u76ee\uff1a\u4f7f\u7528Android Studio\u3001Xcode\u7b49IDE\u521b\u5efaAndroid\u6216iOS\u539f\u751f\u9879\u76ee\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u5f15\u5165WebView\u63a7\u4ef6\u3002<\/p>\n

3. \u5c06\u7f51\u9875\u6587\u4ef6\u6253\u5305\u5230APP\u9879\u76ee\u4e2d\uff1a\u5c06\u7f16\u5199\u597d\u7684HTML\u3001CSS\u3001JS\u7b49\u6587\u4ef6\u6253\u5305\u5230\u539f\u751fAPP\u9879\u76ee\u7684\u8d44\u6e90\u76ee\u5f55\u3002<\/p>\n

4. \u52a0\u8f7d\u5e76\u663e\u793a\u7f51\u9875\u5185\u5bb9\uff1a\u5728\u539f\u751f\u4ee3\u7801\u4e2d\u914d\u7f6eWebView\u63a7\u4ef6\uff0c\u6307\u5b9a\u52a0\u8f7d\u672c\u5730\u6253\u5305\u597d\u7684\u7f51\u9875\u6587\u4ef6\u3002<\/p>\n

5. \u8fdb\u884c\u8bbe\u5907\u8c03\u8bd5\u5e76\u4f18\u5316\uff1a\u6839\u636e\u6d4b\u8bd5\u7ed3\u679c\uff0c<\/p>\n

<\/figure>\n<\/p>\n

\u4f18\u5316WebView\u914d\u7f6e\u53c2\u6570\uff0c\u5982\u7f13\u5b58\u3001\u7981\u6b62\u5f39\u51fa\u7a97\u53e3\u7b49\u3002<\/p>\n

6. \u6253\u5305\u53d1\u5e03APP\uff1a\u7f16\u8bd1\u539f\u751fAPP\u9879\u76ee\uff0c\u751f\u6210.apk\uff08\u5b89\u5353\uff09\u6216.ipa\uff08\u82f9\u679c\uff09\u5b89\u88c5\u5305\uff0c\u63d0\u4ea4\u5230\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u53d1\u5e03\u3002<\/p>\n

\u4e8c\u3001PhoneGap\/Cordova\u6280\u672f<\/p>\n

PhoneGap\u548cApache Cordova\u662f\u4e24\u4e2a\u5f00\u6e90\u7684\u6df7\u5408\u5f0f\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u4eec\u53ef\u4ee5\u5c06\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210\u8de8\u5e73\u53f0\u539f\u751f\u5e94\u7528\u3002<\/p>\n

\u4f7f\u7528PhoneGap\/Cordova\u5f00\u53d1APP\u7684\u57fa\u672c\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n

1. \u8bbe\u8ba1\u5e76\u7f16\u5199HTML\u9875\u9762\uff1a\u540c\u6837\u9700\u8981\u9996\u5148\u5236\u4f5c\u597d\u9002\u7528\u4e8e\u79fb\u52a8\u7aef\u7684\u7f51\u9875\u5e94\u7528\uff0c\u5305\u62ecHTML\u3001CSS\u3001JS\u3001\u56fe\u7247\u7b49\u6587html\u751f\u6210app\u8f6f\u4ef6<\/a>\u4ef6\uff0c\u786e\u4fdd\u5176\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884c\u826f\u597d\u3002<\/p>\n

2. \u5b89\u88c5PhoneGap\/Cordova\u73af\u5883\uff1a\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Node.js\u3001npm\u4ee5\u53caPhoneGap\/Cordova CLI\uff08\u547d\u4ee4\u884c\u63a5\u53e3\uff09\u3002<\/p>\n

3. \u521b\u5efaPhoneGap\/Cordova\u9879\u76ee\uff1a\u4f7f\u7528CLI\u521b\u5efaPhoneGap\/Cordova\u9879\u76ee\uff0c\u5176\u5b9e\u8d28\u662f\u521b\u5efa\u4e00\u4e2aWebView\u5bb9\u5668\uff0c\u7528\u4e8e\u52a0\u8f7d\u7f51\u9875\u5185\u5bb9\u3002<\/p>\n

4. \u5c06\u7f51\u9875\u6587\u4ef6\u653e\u5165\u9879\u76ee\u76ee\u5f55\uff1a\u5c06\u7f16\u5199\u597d\u7684HTML\u3001CSS\u3001JS\u7b49\u6587\u4ef6\u653e\u5165\u9879\u76ee\u7684”www”\u76ee\u5f55\u3002<\/p>\n

5. \u5b89\u88c5\u548c\u4f7f\u7528\u63d2\u4ef6\uff1aPhoneGap\u548cCordova\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u63d2\u4ef6\uff0c\u53ef\u5b9e\u73b0\u8bbf\u95ee\u672c\u5730\u8bbe\u5907\u529f\u80fd\uff0c\u4f8b\u5982\uff1a\u6444\u50cf\u5934\u3001GPS\u5b9a\u4f4d\u7b49\u3002\u4f7f\u7528\u63d2\u4ef6\u65f6\u9700\u5728CLI\u4e2d\u5b89\u88c5\u5bf9\u5e94\u63d2\u4ef6\u5e76\u5728\u7f51\u9875\u4e2d\u8c03\u7528\u63d2\u4ef6API\u3002<\/p>\n

6. \u7f16\u8bd1\u3001\u8c03\u8bd5\u4e0e\u53d1\u5e03\uff1a\u4f7f\u7528CLI\u547d\u4ee4\u8fdb\u884c\u9879\u76ee\u7f16\u8bd1\u3001\u6a21\u62df\u5668\u8c03\u8bd5\u3001\u771f\u673a\u8c03\u8bd5\u7b49\u3002\u6700\u540e\u5c06\u9879\u76ee\u751f\u6210.apk\uff08\u5b89\u5353\uff09\u6216.ipa\uff08\u82f9\u679c\uff09\u5b89\u88c5\u5305\uff0c\u63d0\u4ea4\u5230\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u53d1\u5e03\u3002<\/p>\n

\u603b\u4e4b\uff0cWebView\u548cPhoneGap\/Cordova\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u4e3a\u7f51\u9875\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5c06HTML\u5feb\u901f\u751f\u6210APP\u7684\u9014\u5f84\uff0c\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7f51\u9875\u5e94\u7528\u7684\u5f00\u53d1\u6548\u7387\uff0c\u964d\u4f4e\u5f00\u53d1\u6210\u672c\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5c3d\u7ba1\u8fd9\u4e9b\u65b9\u6cd5\u76f8\u5bf9\u7b80\u5355\uff0c\u4f46\u4e3a\u4e86\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u83b7\u5f97\u826f\u597d\u7684\u6027\u80fd\u8868\u73b0\uff0c\u4ecd\u9700\u8981\u9002\u5f53\u9488\u5bf9\u5b89\u5353\u548c\u82f9\u679c\u8bbe\u5907\u8fdb\u884c\u4f18\u5316\u5de5\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4f7f\u7528HTML\u5feb\u901f\u751f\u6210APP\u7684\u65b9\u6cd5\u4e3b\u8981\u662f\u901a\u8fc7\u5c06\u7f51\u9875\u5e94\u7528\uff08Web App\uff09\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\uff08Native App\uff09\u5b9e\u73b0\u3002\u8fd9\u79cd\u65b9\u6cd5\u517c\u5177\u4e86\u7f51\u9875\u5e94\u7528\u7684\u4fbf\u6377\u5f00\u53d1\u53ca\u8de8\u5e73\u53f0\u7279\u70b9\uff0c\u4ee5\u53ca\u539f\u751f\u5e94\u7528\u7684\u4f18\u70b9\uff0c\u5982\u4f4e\u6210\u672c\u3001\u5feb\u901f\u5f00\u53d1<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[3242,16,3241,149,23],"topic":[],"class_list":["post-1473","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-app-h5--","tag-16","tag-app","tag-149","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1473","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=1473"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1473\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=1473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=1473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=1473"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=1473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}