For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • Sign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Adobe for enterprise
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
Adobe is changing the world through digital experiences. Our creative, marketing and document solutions empower everyone — from emerging artists to global brands — to bring digital creations to life and deliver them to the right person at the right moment for the best results.
    • About Us
    • Newsroom
    • Careers At Adobe
    • Privacy
    • Security
    • Corporate Responsibility
    • Customer Showcase
    • Investor Relations
    • Events
    • Contact Us
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
vat included
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Gaming / Flash Runtimes /

Using Fingerprint native extension

by Abhishek Jain

Abhishek Jain

Content

  • Introduction
  • The ActionScript library
  • Application usage
  • The Android native library
  • Where to go from here

Created

10 February 2016

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
AndroidauthenticationFlash Buildernative extensions
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

Basic familiarity with building mobile apps on Adobe AIR, including familiarity with Adobe Native Extensions.

 

Required third-party products

  • Android SDK
  • Eclipse

User level

All

Required products

  • Flash Builder (Download trial)

Sample files

  • FingerprintANE.zip (189 KB)

Introduction

Fingerprint authentication enables an end-user to use their fingerprint as passcode. With the release of Android 6.0, Google has introduced new APIs to authenticate users by using their fingerprint scans on supported devices.

Fingerprint Native Extension allows an ActionScript developer to access Android's Fingerprint APIs in the AIR app. This article explains how to use this Fingerprint native Extension in your AIR app using sample project files that are available in the attached FingerprintANE.zip file. The zip file contains the following:

  • The ActionScript library in the directory FingerprintLibrary: This directory contains the Flash Builder project for creating the ActionScript side of the Fingerprint extension.
  • The Android native library in the directory FingerprintAndroidLibrary: This directory contains an Eclipse project for creating Android native side of the Fingerprint extension. To build the eclipse project, you need to first copy FlashRuntimeExtension.jar from <AIR_SDK>/lib/android/ to the directory FingerprintAndroidLibrary/libs/.
  • A directory called ReadyToUseExtension: This directory contains everything the AIR you need as a developer to use native extension: the ANE file, the SWC file, and a text file that contains the extension ID.
  • A directory called FingerprintTest: This directory contains a sample AIR application that uses the Fingerprint native extension. 
To the top

The ActionScript library

The Fingerprint class in the ActionScript library provides the following public methods:

  • public function authenticateFingerPrint( ):void
  • public function isSupported( ):Boolean

The AIR application can create many instances of the Fingerprint class. However, the Fingerprint class creates only one ExtensionContext class instance, which is shared by all the Fingerprint instances.

To the top

Application usage

To use Fingerprint ANE, follow these steps:

  1. First create a sample AIR application. You can use the sample project FingerprintTest available in the attached zip for your reference.
  2. Next, add a reference to the ActionScript library in your project. Right-click the project, choose Properties, and then select ActionScript Build Path on the left panel. Click Add SWC and point to the FingerprintLibrary.swc available in ReadyToUseExtension folder of the attached zip file.
Add ActionScript Build Path in Project properties
  1. Double-click Link Type and choose External in the Library Path Item Options dialog and click Ok. This changes the Link Type of the SWC to External. 
Change the link type of the SWC to External
  1. Add the ANE file (Fingerprint.ane available in ReadyToUseExtension folder of the attached zip file) to your project.
  2. To use Fingerprint ANE, create a Fingerprint object to call authenticateFingerPrint() method and also add event handler provided by the ANE.
var fingprint:Fingerprint = new Fingerprint(); fingprint.addEventListener(FingerprintEvent.STATUS,AuthenticateStatus); fingprint.authenticateFingerPrint();
  1. The ANE also contains isSupported() method to check whether the Fingerprint Authentication is supported by the Android device or not. The method returns true if a device is supported, otherwise false. 
if(fingprint.isSupported()) { fingprint.addEventListener(FingerprintEvent.STATUS,AuthenticateStatus); fingprint.authenticateFingerPrint(); }
  1. Be sure to import the following ActionScript library classes:
import com.adobe.FingerprintLibrary.*;
  1. Write the response for the AuthenticateStatus method call. To do so, add the following function:
protected function AuthenticateStatus(event:FingerprintEvent):void { var checkUser:String = "Authorization Status: "+event.status+" "+event.statusReason; }

You may receive the following combination of values for event.status and event.statusReason based on the Fingerprint authentication of a user.

  • If a user is authenticated successfully (fingerprint is recognized), then the value of event.status will be Authenticated and event.statusReason will be Authorized User.
  • If a user is not authenticated (fingerprint is not recognized), then the value of event.status will be Failed and event.statusReason will be Unauthorized User.
  • In some of the cases like cancellation of authentication process or on pressing back button, the value of event.status will be Error and event.statusReason will be Error Occured:Fingerprint operation canceled.
Confirm Fingerprint dialog on Android
Confirm Fingerprint dialog on Android
Fingerprint recognized dialog on Android
Fingerprint recognized dialog on Android

Android Applications

To use Fingerprint APIs on Android 6.0, include the USE_FINGERPRINT permission in your application descriptor file:

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

To the top

The Android native library

The Android native library is implemented in Java, using the native extension Java API. The classes which implement FREFunction get FREContext object as the first parameter and FREObject array as the second parameter in their call() method. The native library includes the following classes:

FingerprintExtension implements FREExtension: This class contains the createContext() method. This method is called by the AIR runtime when ExtensionContext.createExtensionContext() is invoked on the ActionScript side; it returns a FingerprintExtensionContext class instance. The initialize() and dispose() methods are called by the AIR runtime on extension initialization and destruction respectively.

FingerprintExtensionContext extends FREContext: This class contains the getFunctions() method. This is an abstract method returning a Map Object functionMap that associates the extension function keys to the native FREFunction implementations.

FingerprintCheckFunction implements FREFunction: This class is mapped to showFingerprintFunction function key in the FingerprintExtensionContext class. It first checks whether the Fingerprint has been enrolled or not. If Fingerprint exists, it generates the keystore and launches the dialog for Fingerprint Authentication.

FingerprintSupportFunction implements FREFunction: This class is mapped to FingerprintSupportFunction function key in the FingerprintExtensionContext class. It checks whether the current Android Version is above Lollipop or not and then it checks whether the device hardware supports Fingerprint scanning or not. It returns true if supported, otherwise false.

 

To the top

Where to go from here

For more information about developing native extensions for Adobe AIR, see:

  • Extending Adobe AIR
  • Developing Native Extensions for Adobe AIR
  • Adobe native extension samples

For more information about using a native extension in an AIR application, see Using native extensions for Adobe AIR.

More Like This

  • Introducing Concurrency on iOS
  • Introducing compressed textures with the ATF SDK
  • ATF File Format
  • Adobe Texture Format (ATF) tools user's guide
Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices