Back to project page Compass-View-Library.
The source code is released under:
Apache License
If you think the Android project Compass-View-Library listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package garin.artemiy.compassview.library; //from w w w .j ava 2 s . co m import android.content.Context; import android.content.pm.PackageManager; /** * Author: Artemiy Garin * Date: 27.11.13 */ public class CompassUtility { public static boolean isDeviceCompatible(Context context) { return context.getPackageManager() != null && context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER) && context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS); } }