Allow to build Application with Android Fingerprint API in devices below Marshmallow -


i have application uses biometrics (fingerprint api), let users log in. application not have reach users not have marsh mallow devices, below.

when comment line cipher (api level 1), build can run in devices, line uncommented, run in marshmallow device.

i not want solution: https://developer.samsung.com/release-note/view.do?v=r000000009

i have used check:

if (build.version.sdk_int > build.version_codes.lollipop) {     // initialize login activity has fingerprint api } else {     // initialize second login activity not have fingerprint api } 

this because due read ahead or loading mechanisms, dvm detects class has fingerprint api access in method.

am correct there?, or there other way allow log in pre marsh mallow users?

i resolved putting fingerprint api related method, variables in separate class called fingerprintutil. can make declaration of class globally, initialize if os version more lollipop.

private fingerprintutil fingerprintutil;  if (build.version.sdk_int > build.version_codes.lollipop) {     if(fingerprintutil==null){ fingerprintutil = new fingerprintutil(); } fingerprintutil.init(); } else {     // todo:change ui of login activity login using email/social login } 

this way can prevent verification or class not found exception. allowing apk devices lower versions of android os.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -