{"id":14091,"date":"2023-12-29T18:32:51","date_gmt":"2023-12-29T10:32:51","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=14091"},"modified":"2023-12-29T18:32:51","modified_gmt":"2023-12-29T10:32:51","slug":"%e6%89%8b%e6%9c%ba%e7%bd%91%e9%a1%b5%e7%94%9f%e6%88%90app%e4%bb%a3%e7%a0%81%e4%bd%9c%e7%94%a8%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/14091\/","title":{"rendered":"\u624b\u673a\u7f51\u9875\u751f\u6210app\u4ee3\u7801\u4f5c\u7528\u4ecb\u7ecd"},"content":{"rendered":"

\u6807\u9898\uff1a\u624b\u673a\u7f51\u9875\u751f\u6210APP\u4ee3\u7801\u7684\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd<\/p>\n

\u5bfc\u8bed\uff1a\u968f\u7740\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u624b\u673aAPP\u5df2\u7ecf\u6210\u4e3a\u6211\u4eec\u751f\u6d3b\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u91cd\u8981\u5de5\u5177\u3002\u800c\u5c06\u624b\u673a\u7f51\u9875\u751f\u6210\u4e3aAPP\u5219\u4e3a\u521d\u521b\u516c\u53f8\u3001\u4e2a\u4eba\u5f00\u53d1\u8005\u4ee5\u53ca\u4e0d\u65b9\u4fbf\u6295\u5165\u5927\u91cf\u65f6\u95f4\u4e0e\u8d44\u91d1\u7684\u4f01\u4e1a\u63d0\u4f9b\u4e86\u4fbf\u5229\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u624b\u673a\u7f51\u9875\u751f\u6210APP\u7684\u539f\u7406\u53ca\u65b9\u6cd5\u3002<\/p>\n

\u4e00\u3001\u624b\u673a\u7f51\u9875\u751f\u6210APP\u7684\u539f\u7406<\/p>\n

\u624b\u673a\u7f51\u9875\u751f\u6210APP\u7684\u6838\u5fc3\u539f\u7406\u662f\uff1a\u5229\u7528Web\u89c6\u56fe\u5bb9\u5668\uff08WebView\u6216Webview-based\u6846\u67b6\uff0c\u4f8b\u624b\u673a\u7f51\u7ad9app\u751f\u6210<\/a>\u5982Apache Cordova\/PhoneGap\u7b49\uff09\u5c06\u7f51\u9875\u5185\u7684HTML\u3001CSS\u3001JavaScript\u7b49\u8d44\u6e90\u8fdb\u884c\u52a0\u8f7d\u5e76\u5448\u73b0\uff0c\u4ece\u800c\u5b9e\u73b0\u5c06\u7f51\u9875\u5305\u88c5\u6210\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7684\u6548\u679c\u3002\u4ee5\u4e0b\u51e0\u70b9\u4f5c\u4e3a\u8bf4\u660e\uff1a<\/p>\n

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

1. WebView\u4e0eWebview-based\u6846\u67b6\uff1aWebView\u662f\u4e00\u79cd\u5185\u5d4c\u4e8e\u539f\u751f\u5e94\u7528\u4e2d\u7684\u7f51\u9875\u6d4f\u89c8\u5668\u63a7\u4ef6\uff0c\u5b83\u53ef\u4ee5\u52a0\u8f7dURL\u5e76\u663e\u793a\u7f51\u9875\u5185\u5bb9\u3002WebView\u57fa\u4e8e\u7cfb\u7edf\u7684\u6d4f\u89c8\u5668\u7ec4\u4ef6\uff0c\u4f8b\u5982Android\u4e2d\u7684Chromium\uff0ciOS\u4e2d\u7684WebKit\u3002\u7136\u800c\uff0cWebView\u7684\u529f\u80fd\u6709\u9650\uff0c\u56e0\u6b64\u5f00\u53d1\u8005\u4f1a\u9009\u62e9\u4f7f\u7528Webview-based\u6846\u67b6\uff0c\u4f8b\u5982Apache Cordova\/PhoneGap\uff0c\u8fd9\u7c7b\u6846\u67b6\u5728WebView\u7684\u57fa\u7840\u4e0a\u589e\u52a0\u4e86\u4e0e\u539f\u751f\u529f\u80fd\u7684\u8c03\u7528\u63a5\u53e3\uff0c\u5982\u6587\u4ef6\u7cfb\u7edf\u3001\u4f20\u611f\u5668\u3001\u76f8\u673a\u7b49\u3002<\/p>\n

2. \u6df7\u5408\u5f0f\u5e94\u7528\uff08Hybrid App\uff09\uff1a\u901a\u8fc7\u5c06\u7f51\u9875\u751f\u6210APP\u6240\u5f97\u5230\u7684\u5e94\u7528\u88ab\u79f0\u4e3a\u6df7\u5408\u5f0f\u5e94\u7528\u3002\u8fd9\u7c7b\u5e94\u7528\u65e2\u5177\u6709\u7f51\u9875\u5e94\u7528\u7684\u53ef\u8de8\u5e73\u53f0\u7279\u6027\uff0c\u53c8\u5b9e\u73b0\u4e86\u90e8\u5206\u539f\u751f\u5e94\u7528\u7684\u529f\u80fd\uff0c\u80fd\u591f\u5728\u5e94\u7528\u5546\u5e97\u4e2d\u53d1\u5e03\u3002<\/p>\n

3. \u6027\u80fd\u4e0e\u7528\u6237\u4f53\u9a8c\uff1a\u867d\u7136\u6df7\u5408\u5f0f\u5e94\u7528\u7684\u5f00\u53d1\u6210\u672c\u76f8\u8f83\u4e8e\u5b8c\u5168\u539f\u751f\u7684APP\u8981\u4f4e\u4e00\u4e9b\uff0c\u4f46\u5176\u6027\u80fd\u4e0e\u7528\u6237\u4f53\u9a8c\u5f88\u96be\u8fbe\u5230\u539f\u751f\u5e94\u7528\u7684\u6c34\u5e73\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u5bf9\u6027\u80fd\u8981\u6c42\u8f83\u9ad8\u7684\u5e94\u7528\u573a\u666f\uff0c\u53ef\u80fd\u9700\u8981\u8003\u8651\u5176\u4ed6\u7684\u5f00\u53d1\u65b9\u5f0f\uff0c\u5982\u539f\u751f\u5e94\u7528\u6216\u4f7f\u7528ReactNative\u3001Flutter\u7b49\u8de8\u5e73\u53f0\u6846\u67b6\u3002<\/p>\n

\u4e8c\u3001\u624b\u673a\u7f51\u9875\u751f\u6210APP\u7684\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\uff1a<\/p>\n

1. \u4f7f\u7528Apache Cordova\/PhoneGap\uff08\u63a8\u8350\uff09\uff1a<\/p>\n<\/p>\n

Apache Cordova\uff08\u65e9\u671f\u79f0\u4e3aPhoneGap\uff09\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Webview-based\u6846\u67b6\uff0c\u53ef\u4ee5\u5c06HTML\u3001CSS\u3001JavaScript\u4ee3\u7801\u5305\u88c5\u6210\u8de8\u591a\u4e2a\u5e73\u53f0\u7684\u539f\u751f\u5e94\u7528\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528Cordova\u7684\u63d2\u4ef6\u7cfb\u7edf\u8c03\u7528\u539f\u751f\u8bbe\u5907\u529f\u80fd\uff0c\u5982GPS\u3001\u76f8\u673a\u7b49\u3002<\/p>\n<\/p>\n

\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n

a. \u5b89\u88c5Node.js\uff0c\u5e76\u4f7f\u7528npm\u5b89\u88c5Cordova\u547d\u4ee4\u884c\u5de5\u5177\uff1b<\/p>\n

b. \u521b\u5efaCordova\u9879\u76ee\uff0c\u5e76\u4f7f\u7528\u547d\u4ee4\u5c06\u6240\u9700\u7684\u5e73\u53f0\uff08\u5982Android\u3001iOS\uff09\u6dfb\u52a0\u81f3\u9879\u76ee\uff1b<\/p>\n

c. \u5c06\u7f51\u9875\u8d44\u6e90\uff08HTML\u3001CSS\u3001JavaScript\u6587\u4ef6\uff09\u653e\u7f6e\u5728\u201cwww\u201d\u76ee\u5f55\u4e0b\uff1b<\/p>\n

d. \u4f7f\u7528Cordova\u63d2\u4ef6\u8fdb\u884c\u6269\u5c55\u548c\u539f\u751f\u529f\u80fd\u8c03\u7528\uff1b<\/p>\n

e. \u4f7f\u7528Cordova\u547d\u4ee4\u7f16\u8bd1\u5e76\u751f\u6210\u539f\u751f\u5e94\u7528\u3002<\/p>\n

2. \u4f7f\u7535\u8111\u7f51\u7ad9\u751f\u6210\u624b\u673aapp\u5417<\/a>\u7528WebView\u5bb9\u5668\uff1a<\/p>\n<\/p>\n

\u5bf9\u4e8e\u529f\u80fd\u9700\u6c42\u8f83\u7b80\u5355\u7684\u5e94\u7528\uff0c\u53ef\u4ee5\u9009\u62e9\u76f4\u63a5\u4f7f\u7528\u539f\u751f\u5e94\u7528\u5f00\u53d1\u4e2d\u7684WebView\u5bb9\u5668\u3002<\/p>\n

Android\uff1a<\/p>\n

a. \u4f7f\u7528Android Studio\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff1b<\/p>\n

b. \u5728\u4e3bActivity\u4e2d\u52a0\u5165WebView\u7ec4\u4ef6\uff1b<\/p>\n

c. \u5728Activity\u5bf9\u5e94\u7684Java\u4ee3\u7801\u4e2d\u52a0\u8f7d\u5e76\u8bbe\u7f6eWebView\u4ee5\u663e\u793a\u76ee\u6807\u7f51\u9875\u3002<\/p>\n

iOS\uff1a<\/p>\n

a. \u4f7f\u7528Xcode\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff1b<\/p>\n

b. \u5728\u4e3bViewController\u4e2d\u52a0\u5165WKWebView\u7ec4\u4ef6\uff1b<\/p>\n

c. \u5728ViewController\u5bf9\u5e94\u7684Swift\/Objective-C\u4ee3\u7801\u4e2d\u52a0\u8f7d\u5e76\u8bbe\u7f6eWKWebView\u4ee5\u663e\u793a\u76ee\u6807\u7f51\u9875\u3002<\/p>\n

\u603b\u7ed3\uff1a\u901a\u8fc7\u4e0a\u8ff0\u4ecb\u7ecd\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u624b\u673a\u7f51\u9875\u751f\u6210APP\u7684\u539f\u7406\u53ca\u65b9\u6cd5\u3002\u4f7f\u7528Webview-based\u6846\u67b6\u5982Apache Cordova\/PhoneGap\u6216\u76f4\u63a5\u4f7f\u7528WebView\u63a7\u4ef6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u8f7b\u677e\u5b9e\u73b0\u5c06\u7f51\u9875\u8f6c\u6362\u4e3aAPP\u3002\u7136\u800c\uff0c\u7531\u4e8e\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u7684\u5c40\u9650\u6027\uff0c\u5bf9\u4e8e\u5bf9\u6027\u80fd\u8981\u6c42\u8f83\u9ad8\u7684\u5e94\u7528\u573a\u666f\uff0c\u8bf7\u9009\u7528\u5176\u4ed6\u66f4\u9002\u5408\u7684\u6280\u672f\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6807\u9898\uff1a\u624b\u673a\u7f51\u9875\u751f\u6210APP\u4ee3\u7801\u7684\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd\u5bfc\u8bed\uff1a\u968f\u7740\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u624b\u673aAPP\u5df2\u7ecf\u6210\u4e3a\u6211\u4eec\u751f\u6d3b\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u91cd\u8981\u5de5\u5177\u3002\u800c\u5c06\u624b\u673a\u7f51\u9875\u751f\u6210\u4e3aAPP\u5219\u4e3a\u521d\u521b\u516c\u53f8\u3001\u4e2a\u4eba\u5f00\u53d1\u8005\u4ee5\u53ca\u4e0d\u65b9\u4fbf\u6295\u5165\u5927\u91cf\u65f6\u95f4\u4e0e\u8d44<\/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":[1482,384,4788,149,18495],"topic":[],"class_list":["post-14091","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-1482","tag-384","tag-app-","tag-149","tag-app"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/14091","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=14091"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/14091\/revisions"}],"predecessor-version":[{"id":14115,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/14091\/revisions\/14115"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=14091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=14091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=14091"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=14091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}