Skip to content

Instantly share code, notes, and snippets.

try
{
// JAVA : string -> base64
{
String text = "한글";
byte[] data = text.getBytes("UTF-8");
String base64 = Base64.encodeToString(data, Base64.DEFAULT);
Log.d("Unity", "base64="+base64);
}
@thisisone
thisisone / JSONObjectSample.java
Created July 29, 2014 11:44
JAVA JSONObject sample
try
{
JSONObject json = new JSONObject();
json.put("int", 1);
json.put("float", 1.1f);
json.put("bool", true);
json.put("string", "hello");
JSONArray jarr = new JSONArray();
jarr.put("abc");