zathras / jrpn

JRPN - A Calculator Simulator Inspired by the HP-16C "Computer Scientist" Calculator and the HP-15C Scientific Calculator
https://jrpn.jovial.com/
Other
61 stars 7 forks source link

Reports of Key Feedback Not Working #63

Closed billf-pshs closed 10 months ago

billf-pshs commented 11 months ago

There have been reports of key feedback not working in the Android app store.

I strongly suspect that the users don't have touch sounds and/or touch vibrations enabled on their device. If haptic feedback is disabled on the device, there's not much JRPN can do about it!

But, I should update the help screen to point this out.

zathras commented 11 months ago

This could be the issue: https://github.com/flutter/flutter/issues/73987

That's a big either in Flutter, Android, or Samsung's device driver. Since it seems to be Samsung-specific, maybe the latter. Anyway, there's probably nothing an application like JRPN can do about it.

The reports I saw on the play store did mention Samsung, so I think this is likely what's going on.

I'm leaving my issue closed; AFAIK this explains everything, and there's no action I can take to resolve it. Maybe Samsung or Google will fix this bug some day.

Panchdara commented 11 months ago

@billf-pshs I can confirm Haptic and/or Click do not work on OnePlus 7T Android. Haptic and click work very well with Free42/Plus42 apps, but not on this 15C (edit: or 16C) apps. I conclude this failure is not and Android driver (certainly in my case) but in the 15C/16C link to the Android driver?? However, 15C/16C seem to work very well otherwise. I really like these apps, definitely keepers. 👍👍

zathras commented 11 months ago

Thanks, @Panchdara. With a bit of searching, it looks like different models of Android aren't terribly consistent as to what permissions are required. Flutter's SystemSound.play and HapticFeedback.vibrate methods don't mention anything about needing a permission, but perhaps, on some platforms, Manifest.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK and/or Manifest.permission.VIBRATE might be required? Or maybe some other permission?

I looked, and Flutter doesn't automatically add them or anything similar to the merged permissions manifest file, so I think Google doesn't intend that they be required. But they might be anyway on some platforms.

Is this something you could check out? Clearly the permissions aren't required on my phone, since click and haptic work fine on it. I could build an APK that requests these permissions, and send it to you, if you can install it. (That would nuke any stored state you have on the phone, but if there's anything important, you can save it somewhere else via the File menu.) Or, I could probably do a "closed beta" or something on the app store; I think Google doesn't make me jump through too many hoops to do that.

Otherwise, I could check this on a Samsung phone I have lying around. That'd be a couple of months, though, since it's lying around in a storage unit in the US while I'm finishing out my Peace Corps service :-)

Panchdara commented 11 months ago

Hello Bill. Thank you for such an extensive reply. I understand some of what you said- I am not an Android programmer and know little to zip about the api/security side. Pehaps if you were to ask Thomas Okken, developer of Free42 and Plus42 (Free42 being the application on the Swissmicros DM42), he might be abe to point you in the right direction? I don't think you'd be stepping on toes, rather sharing of mutual interests. I's not a pain that the Haptic/click doesn't work, but eyebrow raising that it is an option and does not function. Hopefuly the answer is obvious to yourselves? Thank you again Best Hugh

zathras commented 11 months ago

Hi Hugh,

I'm not asking for technical advice. I'm asking if you'd be willing to test an experimental version where I add a request for the two named permissions.

Panchdara commented 11 months ago

Hi Bill. Sorry for delay in replying - I'm located Isle of Man. Absoulutely be very happy to assist (where I can). Do you need my email? Bestest

zathras commented 11 months ago

It looks like adding <uses-permission android:name="android.permission.VIBRATE"/> to the Android manifest makes haptic feedback work, at least on a OnePlus 7T Android. <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/> didn't make the Android SystemSound.play() API work on this phone, however, and I don't see any other likely permission candidates.

I did find https://github.com/flutter/flutter/issues/57531, where about a month ago this API was listed as not working on a "OnePlus 10T & 6", so maybe this one is just a Flutter/Android bug. There are various workarounds, like hijacking the RingTone API or using a full media player (see https://stackoverflow.com/questions/57374376/how-to-use-systemsound-playsystemsoundtype-click-in-android for links), but that seems like overkill, and maybe equally likely to not work on a different set of phones.

zathras commented 10 months ago

Fixed for at least haptic feedback in 2.1.9.