I am developing an app which lists all hardware features like WiFi, Bluetooth,NFC etc...
I am using PackageManager.hasSystemFeature()
to check.
Similarly Is there anyway to check whether a android device has a spen hardware support or not?
I need to check progrmmatically.
Asked
Active
Viewed 361 times
0

RuntimeException
- 1,201
- 3
- 14
- 25
2 Answers
0
I'm pretty sure this is covered in the developer guide http://developer.samsung.com/:
boolean isSpenFeatureEnabled = false;
Spen spenPackage = new Spen();
try {
spenPackage.initialize(this);
isSpenFeatureEnabled = spenPackage.isFeatureEnabled(Spen.DEVICE_PEN);
} catch (SsdkUnsupportedException e) {
Toast.makeText(this, "This device does not support Spen.", Toast.LENGTH_SHORT).show();
e.printStackTrace();
finish();
} catch (Exception e1) {
Toast.makeText(this, "Cannot initialize Pen.", Toast.LENGTH_SHORT).show();
e1.printStackTrace();
finish();
}

Tunaki
- 132,869
- 46
- 340
- 423

Hendra Anggrian
- 5,780
- 13
- 57
- 97
0
Please note that the samsung spen sdk doesn't only support spen hardware.
For example if you try spenPackage.initialize()
on an old Samsung model like S6 with no physical spen, the initialize() process would also be successful, and you would be able to utilize spen sdk with finger touch.

Lumi Wang
- 73
- 3
- 10