I am just wondering how I can store this string to a variable without getting compile errors. Here is the code:
String htmldata = "<html><head><meta http-equiv="Content-Type" content="text/html; charset=Utf-8"><script type="text/javascript" src="qrcode.js"></script><!-- SJIS Support (optional) --><!--<script type="text/javascript" src="qrcode_SJIS.js"></script>--><script type="text/javascript" src="sample.js"></script><title name="msg">what</title></head><body onload="update_qrcode()"><form><title>whatwhatwhat</title><input type="hidden" name="msg" value="http://www.m.com"></input></br><center><div id="qr"></div></center></form></body></html>";
You have to wrap strings in double quotes in Java. Single quotes are reserved for single characters.
EDIT: You'll have to escape your inner double quotes like so:
String test = "He said \"yo\".";
Here is your string:
String htmldata = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=Utf-8\"><script type=\"text/javascript\" src=\"qrcode.js\"></script><!-- SJIS Support (optional) --><!--<script type=\"text/javascript\" src=\"qrcode_SJIS.js\"></script>--><script type=\"text/javascript\" src=\"sample.js\"></script><title name=\"msg\">what</title></head><body onload=\"update_qrcode()\"><form><title>whatwhatwhat</title><input type=\"hidden\" name=\"msg\" value=\"http://www.bjjbadges.com\"></input></br><center><div id=\"qr\"></div></center></form></body></html>";