I am developing an android application which has a Activity with two buttons apartments and banks. When user clicks on apartments it should parse data from xml file and assign to the listview. This xml file is saved in the assets folder and I want to create some shared preferences for this file. I also want to update the shared preferences if my device finds the Internet connectivity.
This is the structure of my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<address_book>
<apartments>
<apartment>
<name>Villa Alvarado</name>
<street_address>6050 Montezuma Rd San Diego CA 92115</street_address>
<web_address>http://housing.sdsu.edu/housing/apartments.aspx</web_address>
<phone>(619) 594-2747</phone>
</apartment>
<apartment>
<name>Zuma Apartments</name>
<street_address>6237 Montezuma Rd San Diego CA 92115</street_address>
<web_address>http://liveatzuma.com/</web_address>
<phone>(619) 265-9862</phone>
</apartment>
<apartments>
<banks>
<bank>
<name>USE Credit Union</name>
<street_address>5500 Campanile Drive San Diego CA 92182</street_address>
<web_address>https://www.usecu.org/home/home</web_address>
<phone>(866) 873-4968</phone>
</bank>
<bank>
<name>Wells Fargo</name>
<street_address>4690 63rd St San Diego CA 92115</street_address>
<web_address>https://www.wellsfargo.com/</web_address>
<phone>(619) 583-9084</phone>
</bank>
</banks>
</address_book>