#Region Project Attributes
#ApplicationLabel: PartannaLive
#VersionCode: 1
#VersionName: 1.0
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#BridgeLogger: True
#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.
Private timer1 As Timer
Private timer2 As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private WebView1 As WebView
Private ImageView1 As ImageView
Dim WebView1e As WebViewExtras
Private Spinner1 As Spinner
Dim pippo1 As Int
pippo1 = Rnd (3,20)
Dim pippo2 As Int
pippo2 = Rnd (3,20)
Dim pippo3 As Int
pippo3 = Rnd (3,20)
Dim pippo4 As Int
pippo4 = Rnd (3,20)
Dim pippo5 As Int
pippo5 = Rnd (3,20)
Dim pippo6 As Int
pippo6 = Rnd (3,20)
Dim pippo7 As Int
pippo7 = Rnd (3,20)
Dim pippo8 As Int
pippo8 = Rnd (3,20)
Private lblscegli As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
WebView1e.addJavascriptInterface(WebView1, "B4A")
WebView1.JavaScriptEnabled=True
WebView1e.addWebChromeClient(WebView1, "")
WebView1.Color = Colors.ARGB(1, 255, 255, 255)
ImageView1.Color = Colors.ARGB(1, 255, 255, 255)
WebView1.SetLayout(3%x,8%y,93%x,40%y)
ImageView1.SetLayout(3%x,8%y,93%x,40%y)
lblscegli.SetLayout(4%x,41%y,94%x,8%y)
Spinner1.SetLayout(3%x,48%y,93%x,8%y)
timer1.Initialize("timer1",1000)
timer2.Initialize("timer2",500)
timer1.Enabled=True
Spinner1.Add("VIA GRAMSCI")
Spinner1.Add("ROTONDA VIA GRAMSCI")
Spinner1.Add("PIAZZA MERCATO")
Spinner1.Add("VIALE PAPA GIOVANNI NORD")
Spinner1.Add("PIAZZA FALCONE E BORSELLINO")
Spinner1.Add("PIAZZA BELVEDERE")
Spinner1.Add("VEDUTA PONTE C/DA CAMARRO")
Spinner1.Add("ROTONDA VIA XV GENNAIO")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Private Sub WebView1_PageFinished (Url As String)
WebView1.Visible=False
ImageView1.Visible=True
timer1.Enabled=True
End Sub
Sub timer1_Tick
If Spinner1.SelectedItem = "VIA GRAMSCI" Then
WebView1.LoadUrl("http://webcamgramsci.ddns.net:81/webcapture.jpg?user="&pippo1&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "ROTONDA VIA GRAMSCI" Then
WebView1.LoadUrl("http://rotondaviagramsci.ddns.net:83/webcapture.jpg?user="&pippo2&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "PIAZZA MERCATO" Then
WebView1.LoadUrl("http://sav39nas.homepc.it:82/webcapture.jpg?user="&pippo3&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "VIALE PAPA GIOVANNI NORD" Then
WebView1.LoadUrl("http://vialepapagiovanni.ddns.net:84/webcapture.jpg?user="&pippo4&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "PIAZZA FALCONE E BORSELLINO" Then
WebView1.LoadUrl("http://alterego.dvrdns.org:85/webcapture.jpg?user="&pippo5&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "PIAZZA BELVEDERE" Then
WebView1.LoadUrl("http://alterego.dvrdns.org:81/webcapture.jpg?user="&pippo6&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "ROTONDA VIA XV GENNAIO" Then
WebView1.LoadUrl("http://rotondacamarro.ddns.net:83/webcapture.jpg?user="&pippo7&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
else if Spinner1.SelectedItem = "VEDUTA PONTE C/DA CAMARRO" Then
WebView1.LoadUrl("http://pontecamarro.ddns.net:84/webcapture.jpg?user="&pippo8&"&password=partanna&command=snap&channel=1")
timer1.Enabled=False
timer2.Enabled=True
End If
End Sub
Sub timer2_Tick
ImageView1.Bitmap=WebView1.CaptureBitmap
ImageView1.Visible=True
WebView1.Visible=False
timer1.Enabled=True
timer2.Enabled=False
End Sub
Private Sub Spinner1_ItemClick (Position As Int, Value As Object)
End Sub