Android examples for File Input Output:Json String
list To Json String
//package com.java2s; import java.util.List; public class Main { public static String listToJson(String key, List<String> values) { StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append("'" + key + "': ["); for (String database : values) { builder.append("'").append(database).append("',"); }/*from w ww.jav a2 s. c o m*/ builder.deleteCharAt(builder.length() - 1); builder.append("]"); builder.append("}"); return builder.toString(); } }