Android Studio打包H5網(wǎng)址頁(yè)面,封裝成APK
一、下載 AndroidStudio
自行下載安裝,https://developer.android.google.cn/studio/#downloads
二、新建項(xiàng)目
三、配置項(xiàng)目
MainActivity
package com.lmm.myapp; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCompatActivity { private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); webView = new WebView(this); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClientDiy(this)); webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); webView.getSettings().setDomStorageEnabled(true); webView.getSettings().setAppCacheEnabled(true); webView.loadUrl("http://www.sdyztech.com/"); setContentView(webView); } }
WebViewClient
package com.lmm.myapp; import android.content.Context; import android.webkit.WebViewClient; public class WebViewClientDiy extends WebViewClient { Context context; public WebViewClientDiy(Context context){ this.context =context; } }
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.lmm.myapp"> <uses-permission android:name="android.permission.INTERNET"/> <application android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:roundIcon="@drawable/icon" android:supportsRtl="true" android:theme="@style/Theme.AppCompat.Light.NoActionBar"> <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
到此這篇關(guān)于Android Studio打包H5網(wǎng)址頁(yè)面,封裝成APK的文章就介紹到這了,更多相關(guān)Android Studio封裝APK內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Flutter路由跳轉(zhuǎn)參數(shù)處理技巧詳解
這篇文章主要為大家介紹了Flutter路由跳轉(zhuǎn)參數(shù)處理技巧示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-08-08Input系統(tǒng)之InputReader概要性實(shí)例分析
這篇文章主要介紹為大家了Input系統(tǒng)之InputReader概要性實(shí)例分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-11-11Android中實(shí)現(xiàn)水平滑動(dòng)(橫向滑動(dòng))ListView示例
這篇文章主要介紹了Android中實(shí)現(xiàn)水平滑動(dòng)(橫向滑動(dòng))ListView示例,本文用自己封裝一個(gè)控件的方法解決了這個(gè)需求,需要的朋友可以參考下2015-06-06Flutter簡(jiǎn)潔實(shí)用的圖片編輯器的實(shí)現(xiàn)
本文主要介紹了Flutter簡(jiǎn)潔實(shí)用的圖片編輯器的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-02-02Android ExpandableListView長(zhǎng)按事件的完美解決辦法
本篇文章是對(duì)Android中ExpandableListView長(zhǎng)按事件的解決方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06簡(jiǎn)單實(shí)現(xiàn)Android鬧鐘程序 附源碼
這篇文章主要幫助大家簡(jiǎn)單實(shí)現(xiàn)Android鬧鐘程序,附源碼下載,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-07-07Android 輕松實(shí)現(xiàn)語(yǔ)音識(shí)別詳解及實(shí)例代碼
這篇文章主要介紹了Android 輕松實(shí)現(xiàn)語(yǔ)音識(shí)別的相關(guān)資料,并附實(shí)例代碼,需要的朋友可以參考下2016-09-09詳細(xì)分析android的MessageQueue.IdleHandler
這篇文章主要介紹了android的MessageQueue.IdleHandler用法,很有參考價(jià)值,歡迎大家在下方留言區(qū)討論。2017-11-11Android:利用SharedPreferences實(shí)現(xiàn)自動(dòng)登錄
本篇文章主要介紹了Android實(shí)現(xiàn)自動(dòng)登錄,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-11-11