I try to describe what happened to me:
for a long time I used b4a 5.50,
compiled the code with targetsdkversion = 14,
and installed on an android 6.0.1 device,
the apps with the TTS library worked well, without problems.
Recently I purchased a new mobile phone with android 9,
I installed the new b4a 9.80,
recompiling the code with targetsdkversion = 14,
the apps work but the TTS features don't work (and the warning appears: 'the app is developed for an older version of android...').
I tried to set targetsdkversion higher but TTS don't work.
Putting targetsdkversion greater than 21 in addition to TTS features other feature of the apps also don't work.
I don't have the skills to understand what happens and to know what settings I need to do...
I tried to set targetsdkversion =28
the apps don't work and TTS features don't work
with targetsdkversion = 14,
the apps work but only the TTS features don't work (and the warning appears: 'the app is developed for an older version of android...').
First case:
with targetsdkversion = 14,
no error
-all features of the apps work
-only the TTS features don't work: When i call tt.Speak("word",False) (tt as TTS is a global variable) don't speak, and the app continue to work other features
Second case:
I tried to set targetsdkversion =28
one error
-the apps don't work: error=java.lang.RuntimeException: Fail to connect to camera service (the app use camera service to manage image of the camera)
-TTS features don't work
Someone can help me to solve this problem with Android 9 (and targetsdkversion =28) ?
-TTS library features don't work: When i call tt.Speak("word",False) (tt as TTS is a global variable) don't speak
-error=java.lang.RuntimeException: Fail to connect to camera service
is a completely different problem. when sdk = 28, you need runtime permissions.
it sounds like you have several serious problems. you should deal with tts and camera problems separately. start with tts. when i set sdk = 14, tts works on my device. post your code relating to tts. did you initialiaze tts? did you handle the tts ready event? can you hear sound on your device?
is a completely different problem. when sdk = 28, you need runtime permissions.
it sounds like you have several serious problems. you should deal with tts and camera problems separately. start with tts. when i set sdk = 14, tts works on my device. post your code relating to tts. did you initialiaze tts? did you handle the tts ready event? can you hear sound on your device?
-I added the starter.bas service module to project (attached file)
-I changed the Sub InitializeCamera like this (as well as from the code of the Erel example CameraExe)(attached file) :
B4X:
'Private Sub InitializeCamera
' camEx.Initialize(Panel1, frontCamera, Me, "Camera1")
'End Sub
Private Sub InitializeCamera
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
camEx.Initialize(Panel1, frontCamera, Me, "Camera1")
'frontCamera = camEx.Front
Else
ToastMessageShow("No permission!!!", True)
End If
End Sub
Now the camera (after applying for a permit) always opens at every start.
Thank you all