Hello Folks,
sorry for being away so long since the Bada times - well, life had different plans. But I am back now, with a small but pressing question. For a client, I currently work with an S Pen Pro and a Z Fold 3 which my wife lent to me. She was so kind to connect the pen and also has Android 12 installed.
The pen is set up well, and the Z Fold reacts to it both for gestures and stuff in GUI. However, the following code is weird:
public class MainActivity extends AppCompatActivity {
SpenUnitManager mySpenUnitManager;
SpenRemote mySpenRemote;
protected void runAnalysisPayload()
{
if(mySpenRemote.isFeatureEnabled(SpenRemote.FEATURE_TYPE_BUTTON))
{
Log.e("NMG", "Hat Button");
}
if(mySpenRemote.isFeatureEnabled(SpenRemote.FEATURE_TYPE_AIR_MOTION))
{
Log.e("NMG", "Hat Air Motion");
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mySpenRemote = SpenRemote.getInstance();
if (!mySpenRemote.isConnected()) {
mySpenRemote.connect(this,
new SpenRemote.ConnectionResultCallback() {
@Override
public void onSuccess(SpenUnitManager manager) {
mySpenUnitManager = manager;
Log.e("NMG", "Verbindung OK");
runAnalysisPayload();
}
@Override
public void onFailure(int error) {
Log.e("NMG", "Verbindung gescheitert!" + error);
}
});
}
}
}
When we run it, in the ADB, we get the following error:
2022-03-09 13:43:43.818 18250-18250/com.example.nmgspen1 E/SM_SDK: This device does not support SPen Remote.
And none of the callbacks is invoked. May I ask what is going wrong here?