Is it possible to determine if an Android phone has a trackball?

My app requires users to hold the trackball in order to access the advanced menu. However, all phones do not have a trackball, so I need to remove this requirement for such phones. Is there a way to determine if the phone has a trackball?

+5
source share
1 answer

Use an object Configuration, in particular the navigationand fields navigationHidden. You can get the object Configurationthrough getResources().getConfiguration().

+5
source

All Articles