![]() However, if you just to disable specific elements of your application when a feature is missing, you can use the 'PackageManager' class. If your application cannot work without a specific feature being available on the system, you can prevent users from installing your app with a element in your app's manifest file to specify a non-negotiable dependency. For instance, the feature ID for the compass sensor is 'FEATURE_SENSOR_COMPASS'. 'SensorManager' and Sensor are part of Android Sensor Framework and used for direct access and acquistion of raw sensor data.These classes do not provide any method like 'hasSystemFeature()' which is used for evaluation of system capabilities.Īndroid defines feature IDs, in the form of ENUMs, for any hardware or software feature that may be available on a device. The correct answer is Answer 1, the version that uses 'PackageManager'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |