Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim GlobSettings As Map
Dim Nick As String
Dim Pass As String
Dim Numb As String
Dim Langu As Char
Dim BMP As Bitmap
Dim pId As PhoneId
Dim Numbakt = pId.GetLine1Number As String
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 lbl1 As Label ' sprachwahl dialog
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("Layout1")
Activity.LoadLayout("loading")
GlobSettings.Initialize
BMP.Initialize(File.DirAssets, "blubber.jpg")
Startenboot
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Startenboot
ToastMessageShow ("Start", False)
If File.Exists(File.DirInternal, "Settings.txt") Then
ToastMessageShow ("joa", False)
GlobSettings=File.ReadMap(File.DirInternal, "Settings.txt")
Nick=GlobSettings.Get("nick")
Pass=GlobSettings.Get("pass")
Numb=GlobSettings.Get("numb")
Langu=GlobSettings.Get("langu")
Else
GlobSettings.Put("nick", "")
GlobSettings.Put("pass", "")
GlobSettings.Put("numb", "")
GlobSettings.Put("langu", "")
ToastMessageShow ("isnich", False)
File.WriteMap(File.DirInternal, "Settings.txt", GlobSettings)
End If
Sprache
ToastMessageShow("Nach Sprache",True)
If Numb="" Then
Numbakt = pId.GetLine1Number
ToastMessageShow (Numbakt, False)
End If
End Sub
#Region sprachwahl
Sub Sprache
Do While Langu=""
Dim cd As CustomDialog2
Dim pnl As Panel
pnl.Initialize("pnl")
Dim bgnd As ColorDrawable
bgnd.Initialize(Colors.White, 5dip)
pnl.Background = bgnd
Dim langbtn1 As Button
Dim langbtn2 As Button
langbtn1.Initialize("langbtn1")
langbtn2.Initialize("langbtn2")
langbtn1.Text = "Deutsch"
langbtn2.Text = "Englisch"
pnl.AddView(langbtn1, 25dip, 50dip, 90dip, 50dip)
pnl.AddView(langbtn2, 125dip, 50dip, 90dip, 50dip)
lbl1.Initialize("Bitte eine Sprache wählen. Please select language.")
pnl.AddView(lbl1, 80dip, 100dip, 120dip, 60dip)
cd.AddView(pnl, 77%x, 60%y) ' sizing relative to the screen size is probably best
ret = cd.Show("Sprache", "OK", "", "", BMP)
ToastMessageShow("lolo "&Langu,True)
Loop
End Sub
Sub langbtn1_Click
lbl1.Text = "Deutsch gewält"
lbl1.Color = Colors.Blue
ToastMessageShow("Ok", False)
Langu="D"
End Sub
Sub langbtn2_Click
lbl1.Text = "Englisch gewält"
lbl1.Color = Colors.Blue
ToastMessageShow("Ok", False)
Langu="E"
End Sub
#End Region