Android Open Source - Compass-View-Library Compass Utility






From Project

Back to project page Compass-View-Library.

License

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.

Java Source Code

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);
    }

}




Java Source Code List

garin.artemiy.compassview.example.MainActivity.java
garin.artemiy.compassview.library.CompassConstants.java
garin.artemiy.compassview.library.CompassSensorsActivity.java
garin.artemiy.compassview.library.CompassUtility.java
garin.artemiy.compassview.library.CompassView.java