If FirstTime Then' This is the first time the app was run since installation.
' Show the user an hourglass while everything loads.
'------------------------------------------------------------
Activity.LoadLayout("PleaseWait")
PanelPleaseWait.Visible = True
DoEvents
' Set up default configuration settings.
'---------------------------------------
kvConfigurationSettings.Initialize(File.DirDefaultExternal, "kvConfigurationSettings", 1)
kvConfigurationSettings.PutSimple1("UserStoppedService", 0, "No")
' The data for the periods is stored as 9 items for each period.
' This will be loaded into a list the user can alter.
' Key: Period number 1, 2, etc.
' Index 0: Period description.
' Index 1: Period start time.
' Index 2: Peroid end time.
' Index 3: Day of week (Mon) active or inactive.
' Index 4: Day of week (Tue) active or inactive.
' Index 5: Day of week (Web) active or inactive.
' Index 6: Day of week (Thu) active or inactive.
' Index 7: Day of week (Fri) active or inactive.
' Index 8: Day of week (Sat) active or inactive.
' Index 9: Day of week (Sun) active or inactive.
'---------------------------------------------------------------
kvSchoolPeriods.Initialize(File.DirDefaultExternal, "kvSchoolPeriods", 10)
If File.Exists(File.DirDefaultExternal, "kvSchoolPeriods") = False Then
kvSchoolPeriods.PutSimple1("0", 0, "")
kvSchoolPeriods.PutSimple1("0", 1, "")
kvSchoolPeriods.PutSimple1("0", 2, "")
kvSchoolPeriods.PutSimple1("0", 3, "Active")
kvSchoolPeriods.PutSimple1("0", 4, "Active")
kvSchoolPeriods.PutSimple1("0", 5, "Active")
kvSchoolPeriods.PutSimple1("0", 6, "Active")
kvSchoolPeriods.PutSimple1("0", 7, "Active")
kvSchoolPeriods.PutSimple1("0", 8, "Inactive")
kvSchoolPeriods.PutSimple1("0", 9, "Inactive")
kvSchoolPeriods.PutSimple1("1", 0, "")
kvSchoolPeriods.PutSimple1("1", 1, "")
kvSchoolPeriods.PutSimple1("1", 2, "")
kvSchoolPeriods.PutSimple1("1", 3, "Active")
kvSchoolPeriods.PutSimple1("1", 4, "Active")
kvSchoolPeriods.PutSimple1("1", 5, "Active")
kvSchoolPeriods.PutSimple1("1", 6, "Active")
kvSchoolPeriods.PutSimple1("1", 7, "Active")
kvSchoolPeriods.PutSimple1("1", 8, "Inactive")
kvSchoolPeriods.PutSimple1("1", 9, "Inactive")
kvSchoolPeriods.PutSimple1("2", 0, "")
kvSchoolPeriods.PutSimple1("2", 1, "")
kvSchoolPeriods.PutSimple1("2", 2, "")
kvSchoolPeriods.PutSimple1("2", 3, "Active")
kvSchoolPeriods.PutSimple1("2", 4, "Active")
kvSchoolPeriods.PutSimple1("2", 5, "Active")
kvSchoolPeriods.PutSimple1("2", 6, "Active")
kvSchoolPeriods.PutSimple1("2", 7, "Active")
kvSchoolPeriods.PutSimple1("2", 8, "Inactive")
kvSchoolPeriods.PutSimple1("2", 9, "Inactive")
EndIf
' This is the main menu screen.
'------------------------------
LoadMainLayout