private void senserAvailablityCheck() {
PackageManager PM = this.getPackageManager();
boolean acc = PM
.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);
boolean gyroscope = PM
.hasSystemFeature(PackageManager.FEATURE_SENSOR_GYROSCOPE);
if (gyroscope) {
AlertUtility.showToast(MainActivity.this, "Gyroscope available");
}
if (acc) {
AlertUtility.showToast(MainActivity.this, "ACC available");
}
}
PackageManager PM = this.getPackageManager();
boolean acc = PM
.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);
boolean gyroscope = PM
.hasSystemFeature(PackageManager.FEATURE_SENSOR_GYROSCOPE);
if (gyroscope) {
AlertUtility.showToast(MainActivity.this, "Gyroscope available");
}
if (acc) {
AlertUtility.showToast(MainActivity.this, "ACC available");
}
}
No comments:
Post a Comment