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