I need to load a large image (roughly 3500 x 3500 pixels) from assets using a webview.
I've done a lot of research here on Stackoverflow, and yet, none of the answers have worked for me. I figure it might be an issue with Android 4.0+ using assets.
My current code looks like:
WebView webView = (WebView)findViewById(R.id.myWebView);
webView.loadUrl("file:///android_asset/test.html");
test.html looks like:
<html>
<table>
<tr>
<td>
<img src="testimage.png" width="3500px" alt="TestAlt">
</td>
</tr>
</table>
</html>
Both testimage.png and test.html are in the assets. Upon testing this on my physical Android device I get:
Webpage not available The webpage at file:///android_asset/test.html might be temporarily down or it may have moved permanently 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