{"id":16910,"date":"2023-12-13T11:59:55","date_gmt":"2023-12-13T03:59:55","guid":{"rendered":"https:\/\/www.zhidianwl.com\/zhidian\/?p=16910"},"modified":"2023-12-13T11:59:55","modified_gmt":"2023-12-13T03:59:55","slug":"h5-%e8%bd%ac-%e5%ae%89%e5%8d%93%e5%b8%b8%e8%a7%81%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.com\/zhidian\/2023\/16910\/","title":{"rendered":"h5 \u8f6c \u5b89\u5353\u5e38\u89c1\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"

HTML5\u662f\u4e00\u79cd\u6807\u51c6\u5316\u7684Web\u6280\u672f\uff0c\u53ef\u4ee5\u5728\u4efb\u4f55\u8bbe\u5907\u4e0a\u4f7f\u7528\uff0c\u5305\u62ec\u79fb\u52a8\u8bbe\u5907\u548c\u684c\u9762\u8bbe\u5907\u3002\u7531\u4e8eHTML5\u6280\u672f\u7684\u666e\u53ca\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5e94\u7528\u7a0b\u5e8f\u88ab\u5f00\u53d1\u4e3aWeb\u5e94\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5e94\u7528\u7a0b\u5e8f\uff0cWeb\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u53ef\u80fd\u4e0d\u5982\u539f\u751f\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u56e0\u6b64\uff0c\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u539f\u751f\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/p>\n

\u5728\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u539f\u751f\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\uff0c\u9700\u8981\u4e86\u89e3\u4e24\u4e2a\u6982\u5ff5\uff1a\u6df7\u5408\u5e94\u7528\u7a0b\u5e8f\u548c\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u3002\u6df7\u5408\u5e94\u7528\u7a0b\u5e8f\u662f\u6307\u4f7f\u7528\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u6846\u67b6\uff08\u5982Ionic\uff0cPhoneGap\u7b49\uff09\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u5c01\u88c5\u5728\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u662f\u6307\u76f4\u63a5\u4f7f\u7528\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u5de5\u5177\uff08\u5982Andr<\/p>\n

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

oid Studio\uff09\u5f00\u53d1\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u4e0b\u9762\u662f\u5176\u4e2d\u4e24\u79cd\u65b9\u6cd5\u7684\u4ecb\u7ecd\u3002<\/p>\n

\u7b2c\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528Apache Cordova\u3002Apache Cordova\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u53ef\u4ee5\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002\u4f7f\u7528Apache Cordova\u8f6c\u6362HTML5\u5e94\u7528\u7a0b\u5e8f\u4e3a\u539f\u751f\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

1. \u5b89\u88c5Node.js\u548cnpm\uff08Node.js\u5305\u7ba1\u7406\u5668\uff09\u3002<\/p>\n

2. \u5b89\u88c5Cordova\u3002<\/p>\n

“`<\/p>\n

npm install -g cordova<\/p>\n

“`<\/p>\n

3. \u521b\u5efaCordova\u9879\u76ee\u3002<\/p>\n

“`<\/p>\n

cordova create hello com.example.hello HelloWorld<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0chello\u662f\u9879\u76ee\u540d\u79f0\uff0ccom.example.hello\u662f\u5e94\u7528\u7a0b\u5e8f\u7684ID\uff0cHelloWorld\u662f\u5e94\u7528\u7a0b\u5e8f\u7684\u6807\u9898\u3002<\/p>\n

html5 \u6253\u5305apk<\/a>4. \u6dfb\u52a0Android\u5e73\u53f0\u3002<\/p>\n

“`<\/p>\n

cordova platform add android<\/p>\n

“`<\/p>\n

5. \u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u653e\u5728www\u76ee\u5f55\u4e0b\u3002<\/p>\n

6. \u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

“`<\/p>\n

cordova build android<\/p>\n

“`<\/p>\n

\u7b2ctv\u7535\u5f71\u8f6f\u4ef6apk<\/a>\u4e8c\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528React Native\u3002React Native\u662f\u4e00\u4e2a\u7531Facebook\u5f00\u53d1\u7684\u6846\u67b6\uff0c\u53ef\u4ee5\u5c06JavaScript\u4ee3\u7801\u8f6c\u6362\u4e3a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002\u4f7f\u7528React Native\u8f6c\u6362HTML5\u5e94\u7528\u7a0b\u5e8f\u4e3a\u539f\u751f\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

1. \u5b89\u88c5Node.js\u548cnpm\u3002<\/p>\n

2. \u5b89\u88c5React Native\u3002<\/p>\n

“`<\/p>\n

npm install -g react-native-cli<\/p>\n

“`<\/p>\n

3. \u521b\u5efaReact Native\u9879\u76ee\u3002<\/p>\n

“`<\/p>\n

react-native init hello<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0chello\u662f\u9879\u76ee\u540d\u79f0\u3002<\/p>\n

4. \u7f16\u5199JavaScript\u4ee3\u7801\u3002<\/p>\n

5. \u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

“`<\/p>\n

react-native run-android<\/p>\n

“`<\/p>\n

\u4ee5\u4e0a\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u539f\u751f\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u4e14\u90fd\u662f\u514d\u8d39\u7684\u3002\u4f46\u662f\uff0c\u4f7f\u7528Apache Cordova\u8f6c\u6362\u7684\u5e94\u7528\u7a0b\u5e8f\u53ef\u80fd\u4f1a\u6709\u6027\u80fd\u95ee\u9898\uff0c\u800c\u4f7f\u7528React Native\u8f6c\u6362\u7684\u5e94\u7528\u7a0b\u5e8f\u53ef\u80fd\u9700\u8981\u4e00\u4e9bJavaScript\u7f16\u7a0b\u6280\u80fd\u3002\u56e0\u6b64\uff0c\u5728\u9009\u62e9\u8f6c\u6362\u65b9\u6cd5\u4e4b\u524d\uff0c\u9700\u8981\u8003\u8651\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u5f00\u53d1\u96be\u5ea6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HTML5\u662f\u4e00\u79cd\u6807\u51c6\u5316\u7684Web\u6280\u672f\uff0c\u53ef\u4ee5\u5728\u4efb\u4f55\u8bbe\u5907\u4e0a\u4f7f\u7528\uff0c\u5305\u62ec\u79fb\u52a8\u8bbe\u5907\u548c\u684c\u9762\u8bbe\u5907\u3002\u7531\u4e8eHTML5\u6280\u672f\u7684\u666e\u53ca\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5e94\u7528\u7a0b\u5e8f\u88ab\u5f00\u53d1\u4e3aWeb\u5e94\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5e94\u7528\u7a0b\u5e8f\uff0cWeb\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7528<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[23391,14,4839,72,261],"class_list":["post-16910","post","type-post","status-publish","format-standard","hentry","category-zuoapp","tag-aabapk","tag-14","tag-apk","tag-72","tag-261"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=16910"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16910\/revisions"}],"predecessor-version":[{"id":16945,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16910\/revisions\/16945"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=16910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=16910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=16910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}