| | |
| | | public class DeviceMng {
|
| | | public static DeviceMng instance = new DeviceMng();
|
| | |
|
| | | public static final String authorationId = "101";
|
| | | public static String authorationId = null;
|
| | |
|
| | | public static DeviceMng getInstance() {
|
| | | return instance;
|
| | |
| | |
|
| | | public void load () {
|
| | | try {
|
| | | if (authorationId == null || authorationId.trim().length() <= 1) {
|
| | | getAuthorationId();
|
| | | return;
|
| | | }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL + AppApi.Query.DEVICE_QUERY);
|
| | | params.addBodyParameter(Device.FieldNames.authorizationId, authorationId);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void getAuthorationId() {
|
| | | SharedPreferences school = DeviceMng.getInstance().loadSharedPreferences(CommonVariables.DeviceSharedPreferences.SCHOOL);
|
| | | if (!"".equals(school.getString("fragment_device_right_device_info_sn", ""))) {
|
| | | authorationId = school.getString("fragment_device_right_device_info_sn", "");
|
| | | }
|
| | | }
|
| | |
|
| | | public void saveWifiSetting(Map<String, String> fields) {
|
| | | SharedPreferencesUtils.save(CommonVariables.DeviceSharedPreferences.WIFI, fields);
|
| | | }
|
| | |
| | |
|
| | | public void saveSchoolSetting(Map<String, String> fields) {
|
| | | SharedPreferencesUtils.save(CommonVariables.DeviceSharedPreferences.SCHOOL, fields);
|
| | | getAuthorationId();
|
| | | }
|
| | |
|
| | | public void saveCamera1Setting(Map<String, String> fields) {
|