Back to project page PreCTS.
The source code is released under:
Apache License
If you think the Android project PreCTS listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.androidhuman.ctsprepare.automator; // www. jav a 2s. com import org.json.JSONException; import org.json.JSONObject; public class WifiAp { public String apName; public String password; public static WifiAp fromJson(String json) throws JSONException{ JSONObject obj = new JSONObject(json); WifiAp account = new WifiAp(); account.apName = obj.getString("apName"); account.password = obj.getString("password"); if(account.apName==null || account.password==null){ throw new IllegalStateException("Could not load WiFi AP informaion."); } return account; } public String toJson() throws JSONException{ // Check all instance is not null if(this.apName==null || this.password==null){ throw new IllegalStateException("Invalid AP information"); } JSONObject obj = new JSONObject(); obj.put("apName", this.apName); obj.put("password", this.password); return obj.toString(); } }