大学毕业设计 基于android 包含sql代码
package com.json;
import com.google.gson.Gson;
public class jsonTools {
public jsonTools() {
// TODO Auto-generated constructor stub
}
public static T getUser(String jsonstring,Class cls){
T t = null;
try {
Gson gson = new Gson();
t = gson.fromJson(jsonstring, cls);
} catch (Exception e) {
// TODO: handle exception
}
return t;
}
public static String createJsonString(Object value){
Gson gson = new Gson();
String gsonstring = gson.toJson(value);
return gsonstring;
}
}
1