After that, I read the html page from the asset files and inject the json data to be presented:
InputStream is = getApplicationContext().getAssets().open("logs_template.html"); Reader r = new InputStreamReader(is); String details = CharStreams.toString(r); String logsRecords = logsToHTML(); String summary = generateSummary(); details = details.replace("LOGS_HERE",logsRecords ); details = details.replace("SUMMARY_HERE",summary );
The data can be loaded into the WebView by simply load the manipulated String:
lWebView.loadData(details, "text/html", "utf-8"); lWebView.setWebChromeClient(new WebChromeClient());
The HTML file’s content that i load can be found on my github.
Link to google play: here