slugger Member Licensed User Longtime User Mar 27, 2024 #1 Hi, using B4A 12.80 and Phone library 2.53. In one of my apps I declare the following: B4X: Copy Dim pv As PhoneVibrate and then later: B4X: Copy pv.Vibrate(800) A customer said it was working fine on a Xiaomi running Android 13. Recently he upgraded to Android 14 and the vibration hasn't worked since. To make sure the code was executed I made a test version of the app with the following code: B4X: Copy pv.Vibrate(800) ToastMessageShow("Vibration ON",True) He told me the Toastmessage appears on the screen but the phone does not vibrate. Any hints? I need to have the phone vibrate under specific circumstances, say when the clock strikes 11:35...are there alternatives?
Hi, using B4A 12.80 and Phone library 2.53. In one of my apps I declare the following: B4X: Copy Dim pv As PhoneVibrate and then later: B4X: Copy pv.Vibrate(800) A customer said it was working fine on a Xiaomi running Android 13. Recently he upgraded to Android 14 and the vibration hasn't worked since. To make sure the code was executed I made a test version of the app with the following code: B4X: Copy pv.Vibrate(800) ToastMessageShow("Vibration ON",True) He told me the Toastmessage appears on the screen but the phone does not vibrate. Any hints? I need to have the phone vibrate under specific circumstances, say when the clock strikes 11:35...are there alternatives?
Erel B4X founder Staff member Licensed User Longtime User Mar 28, 2024 #2 slugger said: say when the clock strikes 11:35 Click to expand... It will not work when your app is not in the foreground. You need to use StartReceiverAt and show a notification. The notification will cause the phone to vibrate. Upvote 0
slugger said: say when the clock strikes 11:35 Click to expand... It will not work when your app is not in the foreground. You need to use StartReceiverAt and show a notification. The notification will cause the phone to vibrate.
slugger Member Licensed User Longtime User Mar 28, 2024 #3 Thanks for your reply. Erel said: It will not work when your app is not in the foreground. You need to use StartReceiverAt and show a notification. The notification will cause the phone to vibrate. Click to expand... Do you mean that I can't issue a vibrate command at will inside a service? The 11:35 case was just an example, say I want to vibrate the phone inside a service which runs in background when a new mail arrives or any other event that does not occur at a specific time...do I really need a notification to make the phone vibrate? Why under Android 13 it was working fine and under Android 14 doesn't work anymore? Has something changed? The very same part of the code, inside a background service, sends out a vibrate command and a sound (using MediaPlayer), the sound strikes OK while the vibration doesn't. Upvote 0
Thanks for your reply. Erel said: It will not work when your app is not in the foreground. You need to use StartReceiverAt and show a notification. The notification will cause the phone to vibrate. Click to expand... Do you mean that I can't issue a vibrate command at will inside a service? The 11:35 case was just an example, say I want to vibrate the phone inside a service which runs in background when a new mail arrives or any other event that does not occur at a specific time...do I really need a notification to make the phone vibrate? Why under Android 13 it was working fine and under Android 14 doesn't work anymore? Has something changed? The very same part of the code, inside a background service, sends out a vibrate command and a sound (using MediaPlayer), the sound strikes OK while the vibration doesn't.
BlueVision Well-Known Member Licensed User Longtime User Mar 28, 2024 #4 slugger said: Why under Android 13 it was working fine and under Android 14 doesn't work anymore? Has something changed? Click to expand... The mobile's operating system was changed by Google to improve. Upvote 0
slugger said: Why under Android 13 it was working fine and under Android 14 doesn't work anymore? Has something changed? Click to expand... The mobile's operating system was changed by Google to improve.
slugger Member Licensed User Longtime User Mar 28, 2024 #5 BlueVision said: The mobile's operating system was changed by Google to improve. Click to expand... I can hardly call that an improvement. Upvote 0
BlueVision said: The mobile's operating system was changed by Google to improve. Click to expand... I can hardly call that an improvement.
BlueVision Well-Known Member Licensed User Longtime User Mar 28, 2024 #6 slugger said: I can hardly call that an improvement. Click to expand... It was meant sarcastic. However, there are so many odd things with newer versions. It is Google's product, so it is Google's decision to do whatever they want with it. You have unfortunally to live with it. Upvote 0
slugger said: I can hardly call that an improvement. Click to expand... It was meant sarcastic. However, there are so many odd things with newer versions. It is Google's product, so it is Google's decision to do whatever they want with it. You have unfortunally to live with it.