public String IgetFreecourseNameForAndroid() {
JSONObject json = new JSONObject();
try {
json.put("season", "秋季课");
return json.toString();
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
取值
另一个类中
String season = userReg.IgetFreecourseNameForAndroid();
JSONObject obj = new JSONObject(season);
System.out.println( obj.get("season") );