I'm developing an android app that uses Sensors and I would like to know the best way to detect if a device has a specific sensor, let's say, a Proximity Sensor.
Also, is there any "filter" that can be applied to the manifest so users who don't have a proximity sensor won't be able to install the app? If exists, will this "filter" also be valid on Google Play, so users won't be able to see the app?
This is most likely what you are looking for in checking the features programtically
PackageManager PM= this.getPackageManager();
boolean gps = PM.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS);
boolean acc = PM.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);
This link explains what you can do to filter your application in the marketplace, look specifically at the section
Market Filters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With