'Code module
#Region Project Attributes
#ApplicationLabel: B4i Example
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: False
#MinVersion: 7
#End Region
#PlistExtra: <key>UIViewControllerBasedStatusBarAppearance</key><false/>
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Dim hd As HUD
Private cmdTrial As Button
Private pnlBackground As Panel
Dim tm As Timer
Dim iCount As Int
Dim ts As TTS
End Sub
Private Sub Application_Start (Nav As NavigationController)
'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
Page1.RootPanel.LoadLayout("1")
NavControl.NavigationBarVisible = False
NavControl.ShowPage(Page1)
iCount = 0
tm.Initialize("tim", 1000)
ts.Initialize("ts1")
tm.Enabled= False
Dim no As NativeObject = App
no.RunMethod("setStatusBarHidden:animated:", Array(True, False))
End Sub
Sub ts1_Complete (Text As String)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
CommoniOSFunctions.SetGradientHorizontal(pnlBackground, Colors.Blue, Colors.White)
Dim sMessage As StringBuilder
sMessage.Initialize
sMessage.Append(CommoniOSFunctions.GetAppName & "-" & CommoniOSFunctions.GetDeviceName & "-" & _
CommoniOSFunctions.GetDeviceModel & "-" & CommoniOSFunctions.GetDeviceSystemName & "-" & _
CommoniOSFunctions.GetPackageName & "-" & CommoniOSFunctions.GetIMEI & "-" & _
CommoniOSFunctions.GetVersion & "-" & CommoniOSFunctions.GetUDID)
Dim hj As HttpJob
hj.Download("https://<<<<onlineserver>>>>.gr/getip.aspx")
hj.GetRequest.Timeout = 5000
hd.ToastMessageShow("Just before Wait.", True)
Wait For (hj) JobDone(job As HttpJob)
hd.ToastMessageShow("Just after Wait.", True)
If job.Success Then
Msgbox(job.GetString, "IP")
Else
Msgbox(job.ErrorMessage, "IP")
End If
job.Release
hj.Release
Msgbox(sMessage.ToString, "Device Info")
End Sub
Sub tim_Tick
iCount = iCount + 1
If iCount = 5 Then
cmdTrial.Enabled = True
iCount = 0
tm.Enabled = False
End If
End Sub
Private Sub Application_Background
End Sub
Sub cmdTrial_Click
cmdTrial.Enabled = False
ts.SetLanguage("el")
ts.Speak("Αυτή είναι μία πρόταση στα Ελληνικά.", False)
ts.SetLanguage("it")
ts.Speak("Questa è una frase in Italiano... Spero che si ascolta bene.", False)
ts.SetLanguage("en")
ts.Speak("This is a frase in English. Let's see how it will be heard.", False)
ts.SetLanguage("de")
ts.Speak("Ich bin der Lehrer. Sie sind Studenten.", False)
tm.Enabled = True
End Sub