Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static String buildHtmlForIt(String content, boolean isNightMode) { StringBuilder modifiedHtml = new StringBuilder(); modifiedHtml.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">" + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head>" + "<meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=utf-8\"/>" + "<meta http-equiv=\"Cache-control\" content=\"public\" />" + "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0\" />" + "<link rel=\"stylesheet\" href=\"file:///android_asset/news.css\" type=\"text/css\">" + "<script src=\"file:///android_asset/jquery.min.js\"></script>" + "<script src=\"file:///android_asset/info.js\"></script>"); modifiedHtml.append("<body "); if (isNightMode) { modifiedHtml.append("class=\'night\'"); } modifiedHtml.append(">"); modifiedHtml.append(content); modifiedHtml.append("</body></html>"); return modifiedHtml.toString(); } }