#Region Service Attributes
#StartAtBoot: False
#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 frontCamera As Boolean = False
Dim rv As RemoteViews
End Sub
Sub Globals
Dim camEx2 As CameraExClass
End Sub
Sub Service_Create
rv = ConfigureHomeWidget("fls_widget", "rv", 0, "FlashlightSaber")
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
Sub rv_RequestUpdate
rv.UpdateWidget
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub Service_Destroy
End Sub
Sub ButtonW_Click
Dim flashModes As List = camEx2.GetSupportedFlashModes
If flashModes.IsInitialized = False Then
ToastMessageShow("Flash not supported.", False)
Return
End If
If camEx2.GetFlashMode="off" Then
camEx2.SetFlashMode("torch")
Else
camEx2.SetFlashMode("off")
End If
camEx2.CommitParameters
End Sub