How can i detect if spen is active and can only detect touches of spen and disable drawing with finger?

I am creating an app which has a feature of note taking . So how can i detect if the touch event if using spen and not with finger . if it is using finger i dont want to draw on the screen.

If possible can you tell me steps how can i proceed with.

As far as I know the S Pen Remote SDK offered by Samsung does not provide such information. Have you tried to implement it with any Android API?