I need to download a large image (approximately 3500 x 3500 pixels) from assets using web browsing.
I did a lot of research here at Stackoverflow, and yet none of the answers worked for me. I believe this could be an issue with Android 4.0+ using assets.
My current code is as follows:
WebView webView = (WebView)findViewById(R.id.myWebView); webView.loadUrl("file:///android_asset/test.html");
test.html looks like this:
<html> <table> <tr> <td> <img src="testimage.png" width="3500px" alt="TestAlt"> </td> </tr> </table> </html>
Both testimage.png and test.html are in assets. After testing this on my physical Android device, I get:
The webpage is not available. The webpage in the file: ///android_asset/test.html may be temporarily unavailable or it may be transferred to a new web address.
Logcat as requested:
I/webclipboard: clipservice: android.sec.clipboard.ClipboardExManager@43ac41b0 V/webkit: BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {43ac3dc8} D/WebView: loadUrlImpl: called D/webcore: CORE loadUrl: called D/webkit: Firewall not null D/webkit: euler: isUrlBlocked = false D/chromium: Unknown chromium error: -6 I/GATE: <GATE-M>DEV_ACTION_ERROR</GATE-M> V/webkit: reportError errorCode(-1) desc(There was a network error) I/GATE: <GATE-M>DEV_ACTION_COMPLETED</GATE-M> I/Adreno200-EGLSUB: <ConfigWindowMatch:2136>: Format RGBA_8888. D/WebView: onSizeChanged - w:480 h:0 D/WebView: onSizeChanged - w:480 h:446
source share