1

Android 6.0の Android 互換性定義を実行中

次の行が表示されます: 安全なロック画面を備えたデバイスの実装には、指紋センサーを含める必要があります。

これは、実行時にデバイスに指紋スキャナーがあるかどうかを判断する単一バージョンのアプリを使用できないということですか? スキャナーがあると判断した場合、指紋スキャンダイアログを起動します。それ以外の場合は、PIN/パスワードを要求するだけです。

また、API 23 より前の Android バージョンでも同じ apk を使用できますか?

4

1 に答える 1

1

チェックする必要があります

  • デバイス SDK バージョン
  • 指紋ハードウェアの存在
  • 指紋認証対応(指紋登録済み)

    if (Build.VERSION.SDK_INT < 23) {
        // Handle the mechanism where the SDK is older.
    }else{
        // Handle the mechanism where the SDK is 23 or later.
        FingerprintManager fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
        if (!fingerprintManager.isHardwareDetected()) {
            // Device doesn't support fingerprint authentication     
        } else if (!fingerprintManager.hasEnrolledFingerprints()) {
            // User hasn't enrolled any fingerprints to authenticate with 
        } else {
            // Everything is ready for fingerprint authentication 
        }
    }
    
于 2016-05-30T07:40:39.560 に答える