i have a form to get user name , phonenumber, street , province and i want to save this in local with Shared Preferences like this to read i have card for each adress inside tha card it will show the details of the card so how can i do that?
{
"address1": {
"name": "afthal",
"phonenumber": "123456",
"street": "197/F",
"province": "Puttalam"
},
"address2": {
"name": "afthal",
"phonenumber": "123456",
"street": "617/E Mannar",
"province": "Colombo"
},
"address3": {
"name": "afthal",
"phonenumber": "123456",
"street": "45 UC Road",
"province": "Jaffna"
}
}
2
Answers
hope you are fine,
The best solution is to use a local database, but if you insist to use shared preferences, you can do this approach:
Simple Solution:
Instead of storing each address card in the local database, try to convert your
Address Card List
toString
and store thisString
inShared Preferences
which contains all addresses.