如何在 android 应用程序中包含 html 站点的离线可浏览副本

how to include an ofline browsable copy of html site in android app

我正在尝试找到一种方法来实现一个简单的 android 应用程序,该应用程序将包含一个可离线浏览的 html 网站(html、css 和大约 350 mb 的高分辨率图像)并且能够离线呈现该网站。

我尝试将 html 文件放入 assets 文件夹并加载 html 使用: mWebView.loadUrl("file:///android_asset/www/index.html");

它工作正常,但 apk 的大小超过 300 mb,而且速度很慢。

有没有办法做到这一点而不在 apk 文件中包含 html 文件,这样我就不会得到一个 150 mb 的 apk 文件?

问候

你可以实施APk Expansion files.

Google Play currently requires that your APK file be no more than 100MB. For most applications, this is plenty of space for all the application's code and assets. However, some apps need more space for high-fidelity graphics, media files, or other large assets. Previously, if your app exceeded 100MB, you had to host and download the additional resources yourself when the user opens the app. Hosting and serving the extra files can be costly, and the user experience is often less than ideal. To make this process easier for you and more pleasant for users, Google Play allows you to attach two large expansion files that supplement your APK.