Ejemplo n.º 1
0
 @SimpleFunction
 public void StoreValue(String paramString, Object paramObject) {
   SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
   try {
     localEditor.putString(paramString, JsonUtil.getJsonRepresentation(paramObject));
     localEditor.commit();
     return;
   } catch (JSONException paramString) {
     throw new YailRuntimeError("Value failed to convert to JSON.", "JSON Creation Error.");
   }
 }
Ejemplo n.º 2
0
 @SimpleFunction
 public Object GetValue(String paramString, Object paramObject) {
   try {
     paramString = this.sharedPreferences.getString(paramString, "");
     if (paramString.length() == 0) {
       return paramObject;
     }
     paramString = JsonUtil.getObjectFromJson(paramString);
     return paramString;
   } catch (JSONException paramString) {
     throw new YailRuntimeError("Value failed to convert from JSON.", "JSON Creation Error.");
   }
 }