I am developing an app using xamarin forms cross-platform PCL project. I need to know if I can detect whether the device is touch device or not? Is it possible to detect this?
0
votes
refer this link developer.xamarin.com/recipes/android/other_ux/gestures/…
- GorvGoyl
Are you planning to make a TV app ? is that why you are asking ? if so you can know that from the android project in main activity.
- Ahmad ElMadi
@BraveHeart how? do you have sample code
- Sonali
I have sent you the sample , does that answer you question ?
- Ahmad ElMadi
yes it helped. thank you @BraveHeart
- Sonali
2 Answers
2
votes
1
votes
I suppose you are asking this to make a TV app . Well unfortunatly at this moment Xamarin.Forms cannot find that, however you can do this in the main Activity like follows
var uiModeManager = (UiModeManager) GetSystemService(UiModeService);
if (uiModeManager.CurrentModeType == UiMode.TypeTelevision)
{
_isTv = true;
}
else
{
_isTv = false;
}