0

I want to be able to take several 'pieces' of HTML content (either an on-line page or just <html><body><h1>Hello World!</h1></body></html> type Strings) and render the output through OpenGL on 2D/3D objects. To do this, I need to render the HTML content to a Bitmap that I can then create a texture from, therefore I am looking for an offscreen/ non-ui process, but to date have not found anything reliable/ usable. I have been searching for a solution and read a lot of the Q&A's on WebView but through experimentation this doesn't appear to be a reliable solution - resizing has to be done, WebView will only run on the UI thread and capturePicture() isn't working for loadData() method.

https://github.com/flyingsaucerproject/ + http://jsoup.org/ looks promising, but Flying-Saucer relies heavily on awt and Java2D, therefore a port would take quite some time. I'm considering creating an on-line service of these two to generate the page images, but thought I'd ask the questions here before going down that route.

Can anyone suggest a set of tools, a method to access WebKit directly etc?

Mike at Savient
  • 250
  • 2
  • 12
  • Try this http://stackoverflow.com/questions/4633988/generate-bitmap-from-html-in-android – Amit Prajapati Jan 17 '14 at 10:04
  • As mentioned, WebView is not a good solution as it has to be run on the UI thread and when used offscreen (i.e. never visible in the UI) it produces inconsistent results – Mike at Savient Jan 17 '14 at 12:59

0 Answers0