B4A=true Group=Default Group ModulesStructureVersion=1 Type=Service Version=6.8 @EndOfDesignText@ #Region Service Attributes #StartAtBoot: False '#StartCommandReturnValue: android.app.Service.START_STICKY #End Region Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim speak As TTS Dim map As Map End Sub Sub Service_Create 'for tts speak.Initialize("tts") 'for map map.Initialize If File.Exists(File.DirInternal,"basic settings.txt") Then map=File.ReadMap(File.DirInternal, "basic settings.txt") End Sub Sub Service_Start (StartingIntent As Intent) End Sub 'Return true to allow the OS default exceptions handler to handle the uncaught exception. Sub Application_Error (Error As Exception, StackTrace As String) As Boolean LogColor(Error.Message, Colors.Red) Return True End Sub Sub Service_Destroy End Sub 'FOR SPEAKING Sub SpeakOut(say As String, blsay As Boolean) Try If map.Get("language")<>"en" And IsPaused(Main) Then If CheckConnection=True Then Trans(map.Get("language"), say) Else If speak.IsInitialized Then If say.Contains("(") And say.Contains(")") Then Dim i, j As Int i=say.IndexOf("(") j=say.LastIndexOf(")") If i 0) Then If (sa.Length > 0) Then If (strtemp <> "") Then strtemp = strtemp & CRLF strtemp = strtemp & sa(0) End If End If Next If speak.IsInitialized Then If strtemp.Contains("(") And strtemp.Contains(")") Then Dim i, j As Int i=strtemp.IndexOf("(") j=strtemp.LastIndexOf(")") If i