readium/kotlin-toolkit

Replacing the web server by WebViewAssetLoader

mickael-menu opened this issue · 0 comments

@twaddington wrote:

Another thing to be aware of is that the local web server makes all the content accessible to any application running on the device.

This would be a longer term project but, it should be possible to replace the local web server with a custom WebViewAssetLoader and WebViewClient without much difficulty.

This would sandbox all the content to the running app and you wouldn't have to worry about the system killing the web server due to memory pressure.

You should be able to handle range requests on Android as of Lollipop (API 21).

 public WebResourceResponse shouldInterceptRequest (WebView view, 
                WebResourceRequest request)

The WebResourceRequest includes the request headers which should allow you to determine what range is being requested and return the appropriate content. Previously this method only indicated what URL was being requested (not very helpful).

_Originally posted by @twaddington in #245