Example #1
0
 private void f_action_to_auto_login() {
   try {
     app_user_login_req = new interface_app_user_login_req();
     app_user_login_req.setUser_name(PreferencesUtils.getString(this, "user_name"));
     app_user_login_req.setUser_password(PreferencesUtils.getString(this, "user_password"));
     app_user_login_req.setLogin_code(tools.get_phone_imei(this));
     new thread_common_system_user_login(handler, app_user_login_req).start();
   } catch (Exception e) {
     // TODO: handle exception
   }
 }
Example #2
0
  private void init_folder_env() {
    try {

      String sd_path = tools.get_application_dir_path(this);
      PreferencesUtils.putString(this, global_contants.SYS_PATH_SD_CARD, sd_path);
      PreferencesUtils.putString(this, global_contants.SYS_PATH_APP_FOLDER, "/Lovebabies");
      PreferencesUtils.putString(this, global_contants.SYS_PATH_CACHE, "/cache");
      PreferencesUtils.putString(this, global_contants.SYS_PATH_TEMP, "/temp");
      PreferencesUtils.putString(this, global_contants.SYS_PATH_CRASH, "/crash");
      PreferencesUtils.putString(this, global_contants.SYS_PATH_UP, "/up");
      // --
      String app_path =
          PreferencesUtils.getString(this, global_contants.SYS_PATH_SD_CARD)
              + PreferencesUtils.getString(this, "sys_path_app_folder");
      String cache_path =
          app_path + PreferencesUtils.getString(this, global_contants.SYS_PATH_CACHE);
      String temp_path = app_path + PreferencesUtils.getString(this, global_contants.SYS_PATH_TEMP);
      String crash_path =
          app_path + PreferencesUtils.getString(this, global_contants.SYS_PATH_CRASH);
      String up_path = app_path + PreferencesUtils.getString(this, global_contants.SYS_PATH_UP);
      // --
      File folder_root = new File(app_path);
      if (!folder_root.exists()) {
        folder_root.mkdirs();
      }
      // --
      File folder_cache = new File(cache_path);
      if (!folder_cache.exists()) {
        folder_cache.mkdirs();
      }
      // --
      File folder_temp = new File(temp_path);
      if (!folder_temp.exists()) {
        folder_temp.mkdirs();
      }
      // --
      File folder_crash = new File(crash_path);
      if (!folder_crash.exists()) {
        folder_crash.mkdirs();
      }
      // --
      File up_crash = new File(up_path);
      if (!up_crash.exists()) {
        up_crash.mkdirs();
      }
    } catch (Exception e) {
      // TODO: handle exception
    }
  }