{"id":31168,"date":"2024-08-22T15:55:42","date_gmt":"2024-08-22T07:55:42","guid":{"rendered":"https:\/\/www.zhidianwl.net\/zhidianwl\/?p=31168"},"modified":"2024-08-22T15:55:42","modified_gmt":"2024-08-22T07:55:42","slug":"html%e8%bd%ac%e5%ae%89%e5%8d%93%e6%93%8d%e4%bd%9c%e5%8e%9f%e7%90%86%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.net\/zhidianwl\/2024\/08\/22\/html%e8%bd%ac%e5%ae%89%e5%8d%93%e6%93%8d%e4%bd%9c%e5%8e%9f%e7%90%86%e4%bb%8b%e7%bb%8d\/","title":{"rendered":"html\u8f6c\u5b89\u5353\u64cd\u4f5c\u539f\u7406\u4ecb\u7ecd"},"content":{"rendered":"

HTML\u8f6c\u5b89\u5353\u7684\u8fc7\u7a0b\u662f\u5c06\u4e00\u4e2a\u57fa\u4e8eHTML5\u7684Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u5b89\u88c5\u5305\uff0c\u7136\u540e\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u7279\u6b8a\u7684\u5de5\u5177\u6765\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u4e00\u822c\u6765\u8bf4\uff0cWeb\u5e94\u7528\u7a0b\u5e8f\u662f\u57fa\u4e8eHTML\u3001CSS\u548cJavaScript\u6784\u5efa\u7684\u3002\u5728\u5c06\u5176\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\uff0c\u9700\u8981\u5c06\u8fd9\u4e9b\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\u5939\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3a\u201cwww\u201d\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4e00\u4e2a\u53eb\u505a\u201cCordova\u201d\u7684\u6846\u67b6\u6765\u5c06\u8fd9\u4e2a\u6587\u4ef6\u5939\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

Cordova\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u6846\u67b6\uff0c\u53ef\u4ee5\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3aiOS\u3001\u5b89\u5353\u548cWindows Phone\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9bAPI\u6765\u8bbf\u95ee\u8bbe\u5907\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u76f8\u673a\u3001\u5730\u7406\u4f4d\u7f6e\u548c\u901a\u77e5\u7b49\u3002\u540c\u65f6\uff0c\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u63d2\u4ef6\uff0c\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u8f7b\u677e\u5730\u5c06\u81ea\u5df1\u7684Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u4f7f\u7528Cordova\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

1. \u5b89\u88c5Cordova<\/p>\n

\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5Cordova\u3002\u53ef\u4ee5\u5728\u5b98\u65b9\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Cordova\uff0c\u5e76\u6309\u7167\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

2. \u521b\u5efa\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u4f7f\u7528Cordova\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u3002\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Cordova\u9879\u76ee\uff0c\u4f8b\u5982\uff1a<\/p>\n

cordova create myapp com.example.myapp MyApp<\/p>\n

\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmyapp\u201d\u7684\u65b0\u9879\u76ee\uff0c\u5176\u5305\u540d\u4e3a\u201ccom.example.myapp\u201d\uff0c\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u4e3a\u201cMyApp\u201d\u3002<\/p>\n

3. \u6dfb\u52a0\u5e73\u53f0<\/p>\n

\u5728\u521b\u5efa\u9879\u76ee\u540e\uff0c\u9700\u8981\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u5b89\u5353\u5e73\u53f0\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u5b89\u5353\u5e73\u53f0\uff1a<\/p>\n

cordova platform add android<\/p>\n

\u8fd9\u5c06\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684\u5b89\u5353\u5e73\u53f0\u3002<\/p>\n

4. \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/p>\n

\u5728\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\uff0c\u9700\u8981\u7f16\u8f91\u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668ipa\u81ea\u7b7e\u8f6f\u4ef6<\/a>\u6253\u5f00\u201cconfig.xml\u201d\u6587\u4ef6\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u7f16\u8f91\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u7f16\u8f91\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3001\u7248\u672c\u53f7\u3001\u56fe\u6807\u548c\u542f\u52a8\u9875\u7b49\u3002<\/p>\n

5. \u6dfb\u52a0\u63d2\u4ef6<\/p>\n

\u5982\u679cWeb\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u8bbf\u95ee\u8bbe\u5907\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u76f8\u673a\u6216\u5730\u7406\u4f4d\u7f6e\uff0c\u9700\u8981\u6dfb\u52a0\u76f8\u5e94\u7684\u63d2\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u63d2\u4ef6\uff1a<\/p>\n

cordova plugin add cordova-plugin-camera<\/p>\n

\u8fd9\u5c06\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3a\u201ccordova-plugin-camera\u201d\u7684\u63d2\u4ef6\uff0c\u53ef\u4ee5\u8ba9\u5e94\u7528\u7a0b\u5e8f\u8bbf\u95ee\u76f8\u673a\u529f\u80fd\u3002<\/p>\n

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

\u7f16\u8f91\u5b8c\u914d\u7f6e\u6587\u4ef6\u548c\u6dfb\u52a0\u63d2\u4ef6\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u4e86\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u5e94\u7528\u7a0b\u5e8fapp\u4e0a\u67b6\u7b2c\u4e09\u65b9sdk<\/a>\u6253\u5305\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

cordova build android<\/p>\n

\u8fd9\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a\u201cplatforms\/android\/build\/outputs\/apk\u201d\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\u5305\u3002<\/p>\n

7. \u5b89\u88c5\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u6700\u540e\uff0c\u5c06\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5230\u8bbe\u5907\u4e0a\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5230\u8fde\u63a5\u5230\u8ba1\u7b97\u673a\u7684\u8bbe\u5907\u4e0a\uff1a<\/p>\n

cordova run android<\/p>\n

\u8fd9\u5c06\u81ea\u52a8\u5b89\u88c5\u5e94\u7528\u7a0b\u5e8f\u5e76\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002<\/p>\n

\u603b\u7684\u6765\u8bf4\uff0c\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\uff0c\u53ea\u9700\u8981\u4f7f\u7528Cordova\u6846\u67b6\u548c\u4e00\u4e9b\u547d\u4ee4\u884c\u5de5\u5177\u5373\u53ef\u5b8c\u6210\u3002<\/p>\n

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

\u4f46\u662f\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u8f6c\u5316\u7684\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u5e76\u4e0d\u662f\u771f\u6b63\u7684\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u662f\u57fa\u4e8eWeb\u6280\u672f\u7684\u6df7\u5408\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HTML\u8f6c\u5b89\u5353\u7684\u8fc7\u7a0b\u662f\u5c06\u4e00\u4e2a\u57fa\u4e8eHTML5\u7684Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u5b89\u88c5\u5305\uff0c\u7136\u540e\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u7279\u6b8a\u7684\u5de5\u5177\u6765\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u3002\u4e00\u822c\u6765\u8bf4\uff0cWeb\u5e94\u7528\u7a0b\u5e8f\u662f\u57fa\u4e8eH<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27704,681,637,116,322],"topic":[],"class_list":["post-31168","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-apk","tag-exe","tag-637","tag-116","tag-322"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/31168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=31168"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/31168\/revisions"}],"predecessor-version":[{"id":31225,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/31168\/revisions\/31225"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=31168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=31168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=31168"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=31168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}