Android 16 and Haptic feedback

129 views
Skip to first unread message

Marco Polo

unread,
Oct 6, 2025, 9:21:39 AMOct 6
to Free42 & Plus42
I recently moved to an old Honor with Android 9 to a Pixel 9 pro with Android 16.
I lost Haptic feedback in Plus42, despite the app settings.
I am running versio 1.3.10e
What am i doing wrong?

Thank you

Thomas Okken

unread,
Oct 6, 2025, 10:05:23 AMOct 6
to Free42 & Plus42
Go to Main Menu -> Preferences, and move the Haptic Feedback slider to the right. Does that have an effect?

Marco Polo

unread,
Oct 6, 2025, 10:32:43 AMOct 6
to Free42 & Plus42
No effect, unfortunatey

Thomas Okken

unread,
Oct 6, 2025, 12:54:35 PMOct 6
to Free42 & Plus42
Does the key click sound work? And BEEP?

Thomas Okken

unread,
Oct 6, 2025, 5:00:32 PMOct 6
to Free42 & Plus42
If everything else looks normal, could you try installing this apk and checking if the haptic feedback works there:


This is a Free42 test build, not Plus42, but both apps use the same logic for haptic feedback. It looks like the API I'm using for haptic feedback is deprecated, and maybe it no longer works on Android 16? In the test build, I added some logic to use the newer vibration API when it is available.

Steve Falco

unread,
Oct 7, 2025, 10:20:12 AMOct 7
to Free42 & Plus42
I just tried that test build. I don't get any haptic feedback. Key clicks work properly. My phone is using Android 16, build BP3A.250905.014.
Steve

Marco Polo

unread,
Oct 7, 2025, 10:27:37 AMOct 7
to Free42 & Plus42
same results here

Thomas Okken

unread,
Oct 7, 2025, 4:13:35 PMOct 7
to Free42 & Plus42
Hmmm... It looks like the APIs are both still supported, but there has been some incompatible change in Android 16, and now I have to figure out what the issue is and how to work around it. I've done some investigation and haven't found the answer yet.

Poor documentation, google searches that come up empty, and the Android Emulator is no help either. Another day in Android development land. :-/ I'll keep looking; I'll post here when I find something.

Vincent Weber

unread,
Oct 7, 2025, 4:24:47 PMOct 7
to Free42 & Plus42
If it can be of any help, I'm running Plus42 on Android 16 on my Google Pixel 9 fold pro, and I have no issue whatsoever with Haptic feedback... 

Thomas Okken

unread,
Oct 7, 2025, 4:36:58 PMOct 7
to Free42 & Plus42
That is good to know, but it does make the mystery even more mysterious :-D

Marco Polo

unread,
Oct 8, 2025, 2:36:56 AMOct 8
to Free42 & Plus42
In my case the phone is brand new: shipped with Android 14 and updated to 16 before any app installation, so the system is fresh and free.
The build is BP3A.250905.014

Thomas Okken

unread,
Oct 8, 2025, 2:39:11 AMOct 8
to Free42 & Plus42
Marco, Steve: are you able to capture the console logs from your devices, using adb logcat or any other means?

Marco Polo

unread,
Oct 8, 2025, 3:59:51 AMOct 8
to Free42 & Plus42
Urgh!!!
This is quite out of my knowledege.
I need detailed instructions to to this....

Thomas Okken

unread,
Oct 8, 2025, 6:41:36 AMOct 8
to Free42 & Plus42
I'll try to avoid using adb then... It's usually a great source of information, but maybe we won't need it here.

I uploaded a new test build, under the same URL as before. This one uses the latest and greatest vibration APIs, and it extends the range of the slider from up to 181 ms to 1024 ms. If that doesn't help either, the next thing to try would be playing with the vibration amplitude, but that's a setting that isn't guaranteed to be available, so I'm not touching that just yet.

Steve Falco

unread,
Oct 8, 2025, 12:12:13 PMOct 8
to Free42 & Plus42
I have installed adb and I can run logcat.  But I don't know how to use it.  Is there a filter I should apply?  Right now it is putting out lots of messages that are probably unrelated to what we are trying to examine.

Steve Falco

unread,
Oct 8, 2025, 12:20:48 PMOct 8
to Free42 & Plus42

Something interesting.  If I move the haptic slider all the way to the right, I get a long vibration / buzz.  At any other setting, there is no vibration.

I've attached the results of grepping for "thomasokken" in the logcat output if that helps.
foo

Thomas Okken

unread,
Oct 8, 2025, 7:02:30 PMOct 8
to Free42 & Plus42
I don't see anything in that logcat output that looks like it has something to do with our problem, looking for "haptic" and "vibrate" etc. and just eyeballing the rest. Which is good news, I guess; at least there's no indication in that log that Free42 is doing something wrong.

The vibrator working, but only for very long vibrations, is really odd, though. I can't come up with any explanation for what's going on here other than it being an OS bug.

Tomorrow, I'll create another test build that uses VibrationEffect.createPredefined(EFFECT_CLICK). That's the "official" way of doing a key click haptic feedback effect, available since Android 10. You'd hope that that at least should work, assuming that's what the system uses itself. Fingers crossed!

Thomas Okken

unread,
Oct 9, 2025, 7:09:05 AMOct 9
to Free42 & Plus42
I uploaded another test build. In this one, the top three positions (14-16) of the haptic feedback slider select click effects TICK, CLICK, and HEAVY_CLICK, respectively; positions 0 through 13 still cover the same scale of no feedback (0) and 1 to 1024 ms of vibration, using a logarithmic scale (1 through 13).

Note that the experimental code is conditional on running Android 16, as in the previous test builds.

Steve Falco

unread,
Oct 9, 2025, 10:41:01 AMOct 9
to Free42 & Plus42
Now, the top three positions are silent, while position 13 gives a very long vibration, and the bottom ones (1-12) are silent.

I attached a new log.
log.zip

Steve Falco

unread,
Oct 9, 2025, 10:48:10 AMOct 9
to Free42 & Plus42
I also have CalcTastic and RealCalc installed.  For them, none of the haptic settings perform properly - no vibration at all, although audible clicks work.  So I do start to wonder if Android broke this.

Marco Polo

unread,
Oct 9, 2025, 11:11:57 AMOct 9
to Free42 & Plus42
Just tried EMU48 for Android.
Haptic feedback works properly

Steve Falco

unread,
Oct 9, 2025, 11:21:28 AMOct 9
to Free42 & Plus42
Confirmed.  Whatever "EMU48 for Android" is doing for haptic feedback is working correctly.

Steve Falco

unread,
Oct 9, 2025, 11:28:29 AMOct 9
to Free42 & Plus42
It looks like the code is getting a vibrator via `vibrator = ((VibratorManager)getSystemService(Context.VIBRATOR_MANAGER_SERVICE)).getDefaultVibrator();` and then does `Utils.vibrate(vibrator, settings.getInt("settings_haptic_feedback_duration", 25));` to perform the actual feedback.

Thomas Okken

unread,
Oct 10, 2025, 3:44:03 AMOct 10
to Free42 & Plus42
I uploaded a new test build, using the same call as the one used by Emu48.

The relevant API call is:

    long[] vibratePattern = { 0, durationInMilliSecond, 1000 };
    vibrator.vibrate(VibrationEffect.createWaveform(vibratePattern, -1));

I don't understand why the pattern has an odd length, that final 1000 seems redundant. The array of timings is supposed to be alternating durations of the vibrator being off and on, so ending it with an 'off' duration seems like it shouldn't do anything, and the other code examples I could find all have even numbers of entries in the pattern array. But I left it in just in case; if this code works, I'll try if it still works without that final 1000. But for now, one change at a time.

Steve Falco

unread,
Oct 10, 2025, 9:03:21 AMOct 10
to Free42 & Plus42
I just tried it and it worked as expected.  Thanks for your persistence!

Marco Polo

unread,
Oct 10, 2025, 9:44:22 AMOct 10
to Free42 & Plus42
It works as expected also on my phone.

As a side note, Plus42 is not the only app which has problems with Android 16.
I have other three apps which crash immediately, and they are apps from credit card company, phone company., magazines.....
So, Thomas, you are not alone :-D
But you are the only author, in my case, who solved his app's issue. And even quickly!!!

Thank you for your effort

Thomas Okken

unread,
Oct 10, 2025, 10:43:49 AMOct 10
to Free42 & Plus42
Great, that is good to hear!

Could I ask you to try one more test build? It's at the same location as before, and this one has the seemingly-redundant final element removed from the vibration pattern.

If this works, this is going to be the version I release, and otherwise, I'll go with the version that includes that final 1000.

Steve Falco

unread,
Oct 10, 2025, 11:08:00 AMOct 10
to Free42 & Plus42
Does not work.  I guess that final 1000 is necessary.

Thomas Okken

unread,
Oct 10, 2025, 11:37:15 AMOct 10
to Free42 & Plus42
I guess it is. Thanks for trying!

OK, I'll clean up the code, apply the patch to Plus42 as well, and push out new releases.

Thomas Okken

unread,
Oct 10, 2025, 12:33:25 PMOct 10
to Free42 & Plus42
The Free42 and Plus42 updates are in the Play Store now.

Note: If you installed any of the test builds, you'll have to install the update from the store manually. Subsequent updates will be installed automatically again.

Steve Falco

unread,
Oct 10, 2025, 1:23:24 PMOct 10
to Free42 & Plus42
I manually updated both free42 and plus42.  Both now have working haptic feedback.  Thanks for the fix.
Reply all
Reply to author
Forward
0 new messages