Back to project page cnp.
The source code is released under:
MIT License
If you think the Android project cnp 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.urucas.copynpaste.parser; //w w w . j a v a2 s .c o m import org.json.JSONObject; import com.urucas.copynpaste.model.User; public abstract class UserParser { public static User parse(JSONObject jsonObject) { try { int id = jsonObject.getInt("id"); String imei = jsonObject.getString("imei"); String code = jsonObject.getString("code"); return new User(id, imei, code); }catch(Exception e) { return null; } } }