Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Settings")
Dim ApVals As Map
If (File.Exists(File.DirAssets, "ApVals.Txt") = False) Then
ApVals.Initialize
ApVals.Put("location1", "Rhyl")
ApVals.Put("cfgLong1", "53.324044")
ApVals.Put("cfgLat1","-3.506209")
ApVals.Put("location2","")
ApVals.Put("Long2","")
ApVals.Put("Lat2","")
ApVals.Put("location3","")
ApVals.Put("Long3","")
ApVals.Put("Lat3","")
Else
ApVals = File.ReadMap(File.DirAssets, "ApVals.Txt")
txtLocation1.Text=ApVals.Get("location1")
cfgLong1.Text=ApVals.Get("long1")
cnfLat1.Text=ApVals.Get("lat1")
txtLocation2.Text=ApVals.Get("location2")
cfgLong2.Text=ApVals.Get("long2")
cfgLat2.Text=ApVals.Get("lat2")
txtLocation3.Text=ApVals.Get("location3")
cfgLong3.Text=ApVals.Get("long3")
cfgLat3.Text=ApVals.Get("lat3")
End If
End Sub
Sub btnSave_Click
Dim ApVals As Map
File.writeMap(File.DirAssets, "ApVals.Txt",ApVals)
ApVals.Put("location1", txtLocation1.Text) '
ApVals.Put("cfgLong1", cfgLong1.Text)
ApVals.Put("cfgLat1", cnfLat1.Text)
ApVals.Put("location2",txtLocation2.Text)
ApVals.Put("Long2",cfgLong2.Text)
ApVals.Put("Lat2",cfgLat2.Text)
ApVals.Put("location3",txtLocation3)
ApVals.Put("Long3",cfgLong3.Text)
ApVals.Put("Lat3",cfgLat3.Text)
End Sub