Android examples for File Input Output:Json String
boolean Array to Json String
//package com.java2s; public class Main { static String booleanArray2Json(final boolean[] array) { if (array.length == 0) { return "[]"; }// w w w . ja v a2 s . c o m final StringBuilder sb = new StringBuilder(array.length << 4); sb.append('['); for (final boolean o : array) { sb.append(Boolean.toString(o)); sb.append(','); } // set last ',' to ']': sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); } }