Skip to main content

How to know FingerPrint feature available in android? | FingerPrint Feature code too check your mobile Supported or not ?

In Android Version 6.0 Android Marshmallow FingerPrint Features Enable. So, how you code your device support or not ? How to check the FingerPrint code works or not here is the solution for the FingerPrint check is your mobile support or not ?




You know how to get all permission for FingerPrint and how to use but how to know devices support FingerPrint or not ? below is some of code which helps you to know device support or not ?

How to know FingerPrint feature available in android? | FingerPrint Feature code too check your mobile Supported or not ?
How to know FingerPrint feature available in android? | FingerPrint Feature code too check your mobile Supported or not ?


So, Let get Started for FingerPrint...

First, you have to get permission from the Manifest file..

<uses-permission android:name="android.permission.USE_FINGERPRINT"/>


Example 1


if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
    Toast.makeText(this, "Finger print not supported", Toast.LENGTH_SHORT).show();
}

Example 2


FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(Context.FINGERPRINT_SERVICE);
if (!fingerprintManager.isHardwareDetected()) {
    // Device doesn't support fingerprint authentication
    Toast.makeText(this, "Device doesn't support fingerprint authentication", Toast.LENGTH_SHORT).show();
} else if (!fingerprintManager.hasEnrolledFingerprints()) {
    // User hasn't enrolled any fingerprints to authenticate with
   Toast.makeText(this, "User hasn't enrolled any fingerprints to authenticate with", Toast.LENGTH_SHORT).show();
} else {
   // Everything is ready for fingerprint authentication
   Toast.makeText(this, "Everything is ready for fingerprint authentication", Toast.LENGTH_SHORT).show();
}


If you have any Queries regarding the API comment below also share with your Friends

Comments

Popular posts from this blog

Switch : Material Design Tips

From google material design documentation.
On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label. Switches take on the same visual properties of the radio button.
The on/off slide toggle with the text “on” and “off” included within the asset is deprecated. Use the switch shown here instead. How to add? I. In your build.gradle add latest appcompat library. dependencies { compile 'com.android.support:appcompat-v7:X.X.X'// where X.X.X version} II. Make your activity extend android.support.v7.app.AppCompatActivity. publicclassMainActivityextendsAppCompatActivity{...} III. Declare your SwitchCompat inside any layout.xml file <android.support.v7.widget.SwitchCompatandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="true"/> SwitchCompat is a backward compatible version of the Switc…

Raised Button : Material Design Tips

From google material design documentation.
A typically rectangular material button that lifts and displays ink reactions on press. How to add? I. In your build.gradle add latest appcompat library. dependencies { compile 'com.android.support:appcompat-v7:X.X.X'// where X.X.X version} II. Make your activity extend android.support.v7.app.AppCompatActivity. publicclassMainActivityextendsAppCompatActivity{...} III. Declare your Button inside any layout.xml file <Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Button"/> How to style?
I. Declare custom style in your styles.xml file.

Floating Labels : Material Design Tips

From google material design documentation. When the user engages with the text input field, the floating inline labels move to float above the field. How to add? I. In your build.gradle add latest appcompat and design libraries. dependencies { compile 'com.android.support:appcompat-v7:X.X.X'// where X.X.X version compile 'com.android.support:design:X.X.X'// where X.X.X version} II. Make your activity extend android.support.v7.app.AppCompatActivity. publicclassMainActivityextendsAppCompatActivity{...} III. Declare your EditText inside any layout.xml file and wrap it with TextInputLayout. <android.support.design.widget.TextInputLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="@string/Title"/></android.support.design.widget.TextInputLayout>