{"id":45401,"date":"2024-02-29T10:43:12","date_gmt":"2024-02-29T02:43:12","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=45401"},"modified":"2024-02-29T10:43:12","modified_gmt":"2024-02-29T02:43:12","slug":"webview%e6%89%93%e5%8c%85exe%e6%9c%89%e5%95%a5%e6%96%b9%e6%b3%95%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/45401\/","title":{"rendered":"webview\u6253\u5305exe\u6709\u5565\u65b9\u6cd5\uff1f"},"content":{"rendered":"<p>WebView\u662fAndroid\u7cfb\u7edf\u63d0\u4f9b\u7684\u4e00\u4e2a\u63a7\u4ef6\uff0c\u53ef\u4ee5\u5728<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f\/\" title=\"\u5e94\u7528\u7a0b\u5e8f\" target=\"_blank\">\u5e94\u7528\u7a0b\u5e8f<\/a><\/span>\u4e2d\u5d4c\u5165\u7f51\u9875\uff0c\u4f7f\u5f97\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5c55\u793a\u7f51\u9875\u5185\u5bb9\u3002\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06WebView\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a<span class=\"wpcom_keyword_link\"><a href=\"https:\/\/exe.yimenapp.com\" title=\"exe\u5f00\u53d1\u4ece\u4e00\u95e8\u5f00\u59cb\">exe<\/a><\/span><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%96%87%e4%bb%b6\/\" title=\"\u6587\u4ef6\" target=\"_blank\">\u6587\u4ef6<\/a><\/span>\uff0c\u4ee5\u4fbf\u5728Windows\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u5c06WebView\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210exe\u7684\u8fc7\u7a0b\u4e3b\u8981\u5206\u4e3a\u4e24\u4e2a\u6b65\u9aa4\uff1a\u9996\u5148\u662f\u5c06Android\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210apk\u6587\u4ef6\uff0c\u7136\u540e\u5c06apk\u6587\u4ef6\u8f6c\u6362\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u6253\u5305apk\u6587\u4ef6<\/p>\n<p>\u6253\u5305apk\u6587\u4ef6\u7684\u8fc7\u7a0b\u548c\u666e\u901a\u7684Android\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u8fc7\u7a0b\u7c7b\u4f3c\uff0c\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p>1. \u521b\u5efa\u4e00\u4e2aAndroid\u5e94\u7528\u7a0b\u5e8f\u9879\u76ee\uff0c\u5e76\u5c06WebView\u63a7\u4ef6\u6dfb\u52a0\u5230\u4e3b\u754c\u9762\u4e2d\u3002<\/p>\n<p>2. \u5728AndroidManifest.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0\u5fc5\u8981\u7684\u6743\u9650\u548c\u914d\u7f6e\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<\/p>\n<p>    android:minSdkVersion=&#8221;21&#8243;<\/p>\n<p>    android:targe<a href=\"https:\/\/exe.yimenapp.com\/tool-3041.html\">ahk\u6253\u5305exe<\/a>tSdkVersion=&#8221;29&#8243; \/&gt;<\/p>\n<\/p>\n<p>    android:allowBackup=&#8221;true&#8221;<\/p>\n<p>    android:icon=&#8221;@mipmap\/ic_launcher&#8221;<\/p>\n<p>    android:label=&#8221;@string\/<span class=\"wpcom_keyword_link\"><a href=\"https:\/\/www.yimenapp.com\" target=\"_blank\" title=\"\u5f00\u53d1app\u4ece\u4e00\u95e8\u5f00\u59cb\">app<\/a><\/span>_name&#8221;<\/p>\n<p>    android:roundIcon=&#8221;@mipmap\/ic_launcher_round&#8221;<\/p>\n<p>    android:supportsRtl=&#8221;true&#8221;<\/p>\n<p>    android:theme=&#8221;@style\/AppTheme&#8221;&gt;<\/p>\n<p><p><\/p>\n<p><p>&#8220;`<\/p>\n<p>3. \u5728MainActivity.java\u6587\u4ef6\u4e2d\u52a0\u8f7d\u7f51\u9875\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>WebView webView = (WebView) findViewById(R.id.web_view);<\/p>\n<p>webView.loadUrl(&#8220;http:\/\/www.example.com&#8221;);<\/p>\n<p>&#8220;`<\/p>\n<p>4. \u5728bu<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/17\/17\/29771718802.jpg\" \/><\/figure><\/p>\n<p>ild.gradle\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4f9d\u8d56<a href=\"https:\/\/exe.yimenapp.com\/tool-285.html\">exe\u6587\u4ef6\u5c01\u88c5\u6253\u5305<\/a>\u9879\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>dependencies {<\/p>\n<p>    implementation &#8216;androidx.appcompat:appcompat:1.1.0&#8217;<\/p>\n<p>    implementation &#8216;androidx.constraintlayout:constraintlayout:1.1.3&#8217;<\/p>\n<p>    implementation &#8216;androidx.legacy:legacy-support-v4:1.0.0&#8217;<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>5. \u4f7f\u7528Android Studio\u8fdb\u884c\u6253\u5305\uff0c\u751f\u6210apk\u6587\u4ef6\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u8f6c\u6362\u6210exe\u6587\u4ef6<\/p>\n<p>\u5c06apk\u6587\u4ef6\u8f6c\u6362\u6210exe\u6587\u4ef6\u9700\u8981\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>1. \u4f7f\u7528apktool\u5c06apk\u6587\u4ef6\u89e3\u538b\u7f29\uff0c\u751f\u6210\u4e00\u4e2a<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%96%87%e4%bb%b6%e5%a4%b9\/\" title=\"\u6587\u4ef6\u5939\" target=\"_blank\">\u6587\u4ef6\u5939<\/a><\/span>\u3002<\/p>\n<p>2. \u5728\u6587\u4ef6\u5939\u4e2d\u627e\u5230AndroidManifest.xml\u6587\u4ef6\uff0c\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u5e76\u4fee\u6539\uff0c\u5c06\u5176\u4e2d\u7684\u201caction.MAIN\u201d\u548c\u201ccategory.LAUNCHER\u201d\u5220\u9664\u3002<\/p>\n<p>3. \u5728\u6587\u4ef6\u5939\u4e2d\u627e\u5230lib\u6587\u4ef6\u5939\uff0c\u5c06\u5176\u4e2d\u7684armeabi-v7a\u6587\u4ef6\u5939\u5220\u9664\u3002<\/p>\n<p>4. \u4f7f\u7528Launch4j\u5c06\u6587\u4ef6\u5939\u6253\u5305\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>5. \u4f7f\u7528Inno Setup\u7f16\u5199\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5c06exe\u6587\u4ef6\u548c\u76f8\u5173\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u5c06WebView\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u6b65\u9aa4\uff0c\u4f46\u6574\u4e2a\u8fc7\u7a0b\u5e76\u4e0d\u590d\u6742\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8eWebView\u662fAndroid\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a7\u4ef6\uff0c\u56e0\u6b64\u5728Windows\u7cfb\u7edf\u4e0a\u8fd0\u884c\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u9002\u914d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WebView\u662fAndroid\u7cfb\u7edf\u63d0\u4f9b\u7684\u4e00\u4e2a\u63a7\u4ef6\uff0c\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5d4c\u5165\u7f51\u9875\uff0c\u4f7f\u5f97\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5c55\u793a\u7f51\u9875\u5185\u5bb9\u3002\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06WebView\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2aexe\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5728Windows<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9745,21894,2445,2708,8868],"special":[],"attr":[],"class_list":["post-45401","post","type-post","status-publish","format-standard","hentry","category-zixun","tag-windows","tag-axureexe","tag-2445","tag-2708","tag-8868","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/45401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=45401"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/45401\/revisions"}],"predecessor-version":[{"id":45418,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/45401\/revisions\/45418"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=45401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=45401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=45401"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=45401"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=45401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}