I'd like to use a JSON to store 3 values more comfortable.
The Values I want to store are String
, String
and Boolean
.
Where the first string should be used to identify the 3 values from other in the JSON.
At the end - after the user set his setting I would expect the json to look something like this:
{
"Room1":
{
"IP": "192.168.0.2",
"use": "true"
},
"Bathroom":
{
"IP": "192.168.0.3",
"use": "false"
},
"Kitchen":
{
"IP": "192.168.0.4",
"use": "true"
}
.
.
.
.
}
At the end I'd like to "easily" retrieve those values and change some of them (set use
to false, for example).
note: That JSON will be converted to a string and saved in SharedPreferences for later usage.
What would be a good way to implement this? are thery any good tutorials or recommendeds libraries?
If using a json at this point isn't a good idea how else should I do this?