android_asset detailed usage of this URI

For Android projects, we can put small and fragmented files in the assets directory. Today, let's take a look at the uri of android_asset. Compared with the project directory, which is /assets/lix.html, we can generally use the load method of WebView to Load this URI directly, such as testWebView.loadUrl("file:///android_asset/cwj.html"); it should be noted that the file here has an uncompressed limit of 1MB, which means that the uncompressed file can be recognized by Android The file size cannot exceed 1MB, otherwise you will see the information of the Debug type in the logcat. The tag is asset(pid): Data exceeds NCOMPRESS_DATA_MAX (2580997 vs 1048576) Error, then a system error will be generated, System.err , an exception of java.io.IOException will occur.



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324081696&siteId=291194637