Sub Service_Create
Log ("Service_Create")
Main.gService = True
Common.LoadProfile
Notif.Initialize
Notif.Icon = "notification"
Notif.Sound = False
Notif.Vibrate = False
Notif.Light = False
Notif.OnGoingEvent=True
Notif.AutoCancel = True
NotifSound.Initialize(2)
NotifID = NotifSound.Load(File.DirAssets, "notification.ogg")
End Sub
Sub LoadProfile
Dim JsonString As String
Dim JSON As JSONParser
Dim GlobalMap As Map
Dim ResultMap As Map
Dim DataMap As Map
Dim DataList As List
Dim DialogMap As Map
Dim Ind As Int
If File.Exists(File.DirInternal, "Profile.json") == False Then
Return
End If
JsonString = File.GetText (File.DirInternal, "Profile.json")
JSON.Initialize(JsonString)
GlobalMap = JSON.NextObject
ResultMap = GlobalMap.Get("Profile")
Main.gParamEmail = ResultMap.Get("Email")
Main.gParamTipo = ResultMap.Get("Tipo")
Main.gParamDistanza = ResultMap.Get("Distanza")
DataList = ResultMap.Get("Binomi")
DialogMap.Initialize
ClearBinomi
For Ind = 0 To DataList.Size - 1
DataMap = DataList.Get(Ind)
Main.gParamBinomi(Main.gIndBinomi).ID = DataMap.Get("id")
Main.gParamBinomi(Main.gIndBinomi).Conduttore = DataMap.Get("conduttore")
Main.gParamBinomi(Main.gIndBinomi).Concorrente = DataMap.Get("concorrente")
Main.gIndBinomi = Main.gIndBinomi + 1
Next
End Sub