{"id":32539,"date":"2024-03-06T15:40:11","date_gmt":"2024-03-06T07:40:11","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=32539"},"modified":"2024-03-06T15:40:11","modified_gmt":"2024-03-06T07:40:11","slug":"%e7%bd%91%e9%a1%b5%e6%89%93%e5%8c%85apk%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appkaifa\/32539.html","title":{"rendered":"\u7f51\u9875\u6253\u5305apk\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"<p>\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\uff1a\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd<\/p>\n<p>\u968f\u7740\u8fc7\u53bb\u51e0\u5341\u5e74\u91cc\u79d1\u6280\u7684\u98de\u901f\u8fdb\u6b65\uff0c\u7f51\u7edc\u53d8\u5f97\u8d8a\u6765\u8d8a\u5f3a\u5927\uff0c\u7f51\u9875\u5e94\u7528\u4e5f\u5728\u4e0d\u65ad\u5730\u53d1\u5c55\u5b8c\u5584\u3002\u5f88\u591a\u4f01\u4e1a\u548c\u7f51\u7ad9\u5e0c\u671b\u771f\u6b63\u638c\u63e1\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u529b\u91cf\uff0c\u901a\u8fc7\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u6253\u5305\u6210\u4e00\u4e2a\u672c\u5730\u5e94\u7528\uff0c\u8fdb\u5165\u667a\u80fd\u624b\u673a\u5e02\u573a\u3002\u8fd9\u5c31\u662f\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\u7684\u60f3\u6cd5\u3002\u672c\u7bc7\u6559\u7a0b\u5c06\u7814\u7a76\u5982\u4f55\u5c06\u73b0\u6709\u7684\u7f51\u9875\u8f6c\u5316\u4e3a\u4e00\u4e2aAPK\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5728Android\u8bbe\u5907\u4e0a\u8fdb\u884c\u5b89\u88c5\u3002\u540c\u65f6\uff0c\u6211\u4eec\u5c06\u89e3\u91ca\u8be5\u8fc7\u7a0b\u7684\u57fa\u672c\u539f\u7406\u548c\u6280\u672f\u7ec6\u8282\u3002<\/p>\n<p>\u5728\u6211\u4eec\u5f00\u59cb\u4e4b\u524d\uff0c\u8ba9\u6211\u4eec\u5148\u4e86\u89e3\u4ec0\u4e48\u662fAPK\u6587\u4ef6\u3002APK\uff08Android Package Kit\uff09\u6587\u4ef6\u662fAndroid\u64cd\u4f5c\u7cfb\u7edf\u6240\u4f7f\u7528\u7684\u5b89\u88c5\u5305\u6587\u4ef6\u683c\u5f0f\u3002\u8fd9\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u5c06\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u5e76\u5206\u53d1\u5230Android\u8bbe\u5907\u3002\u4e3a\u4e86\u5b8c\u6210\u8fd9\u4e00\u8fc7\u7a0b\uff0c\u7f51\u9875\u7ecf\u5386\u4e00\u7cfb\u5217\u7684\u8f6c\u6362\u8fc7\u7a0b\uff0c\u5305\u62ec\u7f16\u7801\u3001\u5c01\u88c5\uff0c\u6700\u540e\u4ee5APK\u6587\u4ef6\u7684\u7c7b\u578b\u5bfc\u51fa\u3002<\/p>\n<p>\u90a3\u4e48\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\u7684\u539f\u7406\u662f\u4ec0\u4e48\u5462\uff1f\u5b9e\u9645\u4e0a\uff0c\u8fd9\u5176\u4e2d\u7684\u6838\u5fc3\u6280\u672f\u662f\u4f7f\u7528\u201cWebView\u5bb9\u5668\u201d\u3002WebView\u5bb9\u5668\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u4ed6\u4eec\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u663e\u793a\u7f51\u9875\u5185\u5bb9\uff0c\u8fd9\u6837\u5c31\u4f7f\u5f97\u7f51\u9875\u80fd\u591f\u5728\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8fd0\u884c\uff0c\u5c31\u50cf\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u4e00\u6837\u3002\u4e3e\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u7f51\u9875\u7248\u7684\u535a\u5ba2\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5c06\u5176\u6253\u5305\u6210APK\u6587\u4ef6\uff0c\u7136\u540e\u5728Android\u8bbe\u5907\u4e0a\u5c06\u5176\u4f5c\u4e3a\u72ec\u7acb\u7684\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u3002\u7528\u6237\u4e0d\u518d\u9700\u8981\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u4f60\u7684\u535a\u5ba2\uff0c\u800c\u662f\u53ef\u4ee5\u76f4\u63a5\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u6765\u83b7\u53d6\u5185\u5bb9\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5bf9\u5982\u4f55\u5c06\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\u7684\u8be6\u7ec6\u8fc7\u7a0b\u8fdb\u884c\u89e3\u91ca\u3002\u6211\u4eec\u5c06\u5206\u6210\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u9610\u8ff0\uff1a<\/p>\n<p>1. \u51c6\u5907\u5de5\u4f5c\uff1a\u9996\u5148\u4f60\u9700\u8981\u4e0b\u8f7d\u5e76\u5b89\u88c5Android Studio\uff08\u4e00\u4e2a\u5168\u9762\u7684\u5f00\u53d1\u73af\u5883\uff0c\u7528\u4e8e\u5f00\u53d1Android\u5e94\u7528\u7a0b\u5e8f\uff09\u3002\u53e6\u5916\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86Java Development Kit (JDK)\u3002<\/p>\n<p>2. \u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\uff1a\u5728Android Studio\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Android\u5e94\u7528\u9879\u76ee\u3002\u5728\u9879<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-672.html\">\u5c01\u9762\u5236\u4f5c\u7f51\u7ad9<\/a>\u76ee\u5411\u5bfc\u4e2d\uff0c\u9009\u62e9\u201cEmpty Activity\u201d\u6a21\u677f\u3002\u63a5\u4e0b\u6765\uff0c\u4e3a\u9879\u76ee\u8bbe\u7f6e\u4e00\u4e2a\u540d\u79f0\u3001\u4f01\u4e1a\u57df\u540d\u53ca\u4fdd\u5b58\u8def\u5f84\u7b49\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<p>3. \u914d\u7f6eWebView\uff1a\u6253\u5f00activity_main.xml\u6587\u4ef6\uff0c\u5c06\u5df2\u6709\u7684\u6587\u672c\u5185\u5bb9\u66ff\u6362\u4e3aWebView\u7ec4\u4ef6\u3002\u5728\u8fd9\u91cc\uff0c\u4f60\u8fd8\u9700\u8981\u6307\u5b9a\u4e00\u4e2aID\u4ee5\u53caWebView\u7ec4\u4ef6\u7684\u5e03\u5c40\u5c5e\u6027\u3002<\/p>\n<p>4. \u6dfb\u52a0\u7f51\u7edc\u6743\u9650\uff1a\u7531\u4e8e\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u8bbf\u95ee\u7f51\u7edc\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u5728AndroidManifest.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0\u7f51\u7edc\u6743\u9650\u3002\u6dfb\u52a0\u76f8\u5e94\u7684\u6743\u9650\u4ee3\u7801\u5373\u53ef\u3002<\/p>\n<p>5. \u5f00\u542fWebView\u5bb9\u5668\uff1a\u63a5\u4e0b\u6765\uff0c\u5728MainActivity.java\u6587<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-04\/07\/10\/02461764502.jpg\" \/><\/figure>\n<\/p>\n<p>\u4ef6\u4e2d\u914d\u7f6eWebView\u7ec4\u4ef6\u3002\u9996\u5148\uff0c\u9700\u8981\u5f15\u5165\u5fc5\u8981\u7684\u5305\uff0c\u7136\u540e\u901a\u8fc7ID\u627e\u5230\u5148\u524d\u6dfb\u52a0\u7684WebView\u7ec4\u4ef6\u3002\u4e3aWebView\u7ec4\u4ef6\u8bbe\u7f6eWebChromeClient\u548cWebViewClient\uff0c\u7528\u4e8e\u5904\u7406 JavaScript \u5bf9\u8bdd\u6846\u3001\u6e32\u67d3\u4f18\u5316\u7b49\u95ee\u9898\u3002\u5728WebView\u8bbe\u7f6e\u4e2d\u542f\u7528JavaScript\u652f\u6301\uff0c\u6700\u540e\u52a0\u8f7d\u76ee\u6807\u7f51\u9875\u3002<\/p>\n<p>6. \u6253\u5305AP<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-598.html\">html\u5c01\u88c5app\u7535\u89c6<\/a>K\u6587\u4ef6\uff1a\u5728Android Studio\u4e2d\uff0c\u4ece\u9876\u90e8\u5de5\u5177\u680f\u9009\u62e9\u201cBuild\u201d &gt; \u201cBuild Bundle(s) \/ APK(s)\u201d &gt; \u201cBuild APK(s)\u201d\u3002\u751f\u6210\u7684APK\u6587\u4ef6\u5c06\u4fdd\u5b58\u5728\u9879\u76ee\u7684\u8f93\u51fa\u76ee\u5f55\u4e2d\u3002<\/p>\n<p>7. \u5b89\u88c5\u6d4b\u8bd5\uff1a\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u5c06\u751f\u6210\u7684APK\u6587\u4ef6\u590d\u5236\u5230Android\u8bbe\u5907\u5e76\u8fdb\u884c\u5b89\u88c5\u3002\u786e\u4fdd\u5728\u8bbe\u5907\u7684\u8bbe\u7f6e\u4e2d\u5f00\u542f\u4e86\u5141\u8bb8\u4ece\u672a\u77e5\u6765\u6e90\u5b89\u88c5\u5e94\u7528\u7a0b\u5e8f\u7684\u529f\u80fd\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u5c06\u770b\u5230\u4f60\u7684\u7f51\u7ad9\u5df2\u6210\u529f\u8f6c\u5316\u4e3a\u4e00\u4e2a\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\u5e76\u4e0d\u9002\u7528\u4e8e\u6240\u6709\u573a\u666f\u3002\u4f8b\u5982\uff0c\u4e00\u4e9b\u9ad8\u5ea6\u52a8\u6001\u548c\u4ea4\u4e92\u5f0f\u7684\u7f51\u9875\u53ef\u80fd\u5728WebView\u5bb9\u5668\u4e2d\u65e0\u6cd5\u8fd0\u884c\u3002\u6b64\u5916\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5e76\u4e0d\u80fd\u4ee3\u66ff\u4ece\u5934\u5f00\u53d1\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8bae\uff1a<\/p>\n<p>&#8211; \u5982\u679c\u4f60\u7684\u7f51\u7ad9\u4e3b\u8981\u662f\u9759\u6001\u5185\u5bb9\uff0c\u4f8b\u5982\u7ebf\u4e0a\u6742\u5fd7\u3001\u65b0\u95fb\u95e8\u6237\u7b49\uff0c\u6253\u5305\u6210APK\u6587\u4ef6\u53ef\u80fd\u662f\u4e00\u4e2a\u597d\u529e\u6cd5\u3002<\/p>\n<p>&#8211; \u5982\u679c\u4f60\u7684\u7f51\u7ad9\u5305\u542b\u8bb8\u591a\u5185\u5bb9\u6216\u529f\u80fd\uff0c\u6216\u8005\u9700\u8981\u9ad8\u5ea6\u7684\u672c\u5730\u529f\u80fd\u96c6\u6210\uff0c\u8003\u8651\u5f00\u53d1\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u5c06\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\u662f\u4e00\u4e2a\u65b9\u4fbf\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5141\u8bb8\u7528\u6237\u5728\u4e0d\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u60c5\u51b5\u4e0b\u8bbf\u95ee\u7f51\u7ad9\u3002\u901a\u8fc7\u4f7f\u7528Android Studio\u548cWebView\u5bb9\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u73b0\u6709\u7684\u7f51\u7ad9\u5185\u5bb9\u5305\u88c5\u6210\u4e00\u4e2a\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728Android\u8bbe\u5907\u4e0a\u5b89\u88c5\u548c\u8fd0\u884c\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u53ef\u80fd\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u9875\u6253\u5305\u6210APK\u6587\u4ef6\uff1a\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd\u968f\u7740\u8fc7\u53bb\u51e0\u5341\u5e74\u91cc\u79d1\u6280\u7684\u98de\u901f\u8fdb\u6b65\uff0c\u7f51\u7edc\u53d8\u5f97\u8d8a\u6765\u8d8a\u5f3a\u5927\uff0c\u7f51\u9875\u5e94\u7528\u4e5f\u5728\u4e0d\u65ad\u5730\u53d1\u5c55\u5b8c\u5584\u3002\u5f88\u591a\u4f01\u4e1a\u548c\u7f51\u7ad9\u5e0c\u671b\u771f\u6b63\u638c\u63e1\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u529b\u91cf\uff0c\u901a\u8fc7\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u6253\u5305\u6210\u4e00\u4e2a\u672c\u5730\u5e94\u7528\uff0c\u8fdb<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[11284,21011,1775,802,1014],"class_list":["post-32539","post","type-post","status-publish","format-standard","hentry","category-appkaifa","tag-app","tag-uosapk","tag-1775","tag-802","tag-1014"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/32539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=32539"}],"version-history":[{"count":1,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/32539\/revisions"}],"predecessor-version":[{"id":32763,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/32539\/revisions\/32763"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=32539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=32539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=32539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}