I wonder if there is a way to programmatically detect if the pen is physically in the phone (Samsung Note 8/9)? Like getting readings directly from the sensor?
I am aware that there is the SpenPenDetachmentListener
which catches detach and attach events. But I need to get a status of the pen without actually taking the pen out.
I also tried using the InputDevicesManager to detect the pen as an input device, yet this won't tell whether the pen is attached or not.
Any idea would be appreciated!