Adjunto el codigo:
en el main:
en el main:
B4X:
#Region Project Attributes
#ApplicationLabel: Bomberos
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
'unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public SQL1 As SQL
Public FTP1 As FTP
Dim List1 As List
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Label1 As Label
Dim Label2 As Label
Private EditText1 As EditText
Private EditText2 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
File.MakeDir(servicio.DBFilePath,"bomberos")
If File.Exists(servicio.DBFilePath&servicio.GLOCarpetaLocal, servicio.DBFileName)=False Then
SQLCreateTable
End If
EditText1.Text=""
EditText2.Text=""
List1 = File.ReadList(servicio.DBFilePath&servicio.GLOCarpetaLocal, servicio.DBFileName)
'Msgbox("List1.Size = " & List1.Size & CRLF & "The third item is: " & List1.Get(2), "")
EditText1.Text= List1.Get(1)
EditText2.Text= List1.Get(2)
servicio.GloSeudonimo = List1.Get(2)
StartService(servicio)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
StartService(servicio)
End Sub
Sub Button2_Click
CancelScheduledService(servicio) ' Para el StartServiceAt
StopService(servicio)
End Sub
Sub muestra
Label1.Text = servicio.hora
Label2.Text = servicio.current_min
End Sub
Sub SQLCreateTable
List1.Initialize
List1.Add("") 'id del alerta
List1.Add("") 'id del bombero
List1.Add("") 'nombre del bombero
File.WriteList(servicio.DBFilePath&servicio.GLOCarpetaLocal, servicio.DBFileName, List1)
End Sub
Last edited: