so, here's an example with javaobject. i've spread things out a little to show step by step. it compiles but throws a runtime error:
textToVoice failed: (RuntimeException) java.lang.RuntimeException: Method: textToVoice not found in: android.telephony.TelephonyManager
Dim message As String = "hello, world"
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim telephonymanager As JavaObject = ctxt.RunMethod("getSystemService", Array("phone"))
If telephonymanager.isinitialized Then
Try
telephonymanager.RunMethod("textToVoice",Array(message))
Catch
Log("textToVoice failed: " & LastException)
End Try
Else
Log("could not initialize telephony manager")
End If
as i mentioned early on, textToVoice() is not in the telephonymanager class used by b4a (or android studio, i would think).
technically, if you had a third party jar, you can use it with b4a with the #additionaljar option. in which case, you would point
a java object to it. do you have such a jar?