Enable a Fingerprint Scanner for Android on the Motorola ATRIX 4G
The Motorola ATRIX 4G is one of the exciting new dual-core Android smartphones to hit the market this year. One of its most compelling security features is its first-of-its-kind fingerprint reader or scanner. The fingerprint scanner is located on the back of the device, enabling users to unlock their devices at the swipe of a finger as opposed to entering cumbersome numeric codes or passwords.
This past month, Motorola and AuthenTec have released several free SDKs which allow developers to incorporate fingerprint scanning features directly into Android applications. In this article, we'll discuss how to get up and running developing for this exciting device and using these new SDKs.
What You'll Need for This Tutorial
There are a number of prerequisites for this tutorial. You will need to be familiar with the Android development environment. We assume you have a computer set up to develop Android applications, with the appropriate IDE (such as Eclipse) and the Android SDK (Gingerbread, Android 2.3.4+) installed for development purposes. You will also need a Motorola ATRIX 4G device. You cannot use the emulator to complete this tutorial.
For your SDK, there are two available--one for light integration and one for full integration--using the fingerprint reader.
- The Mobile SDK for Android provides lightweight fingerprint support, allowing an Android application to determine if the fingerprint reader is configured properly. Your applications can prompt the user to see if their fingerprint matches the fingerprint on file or enter their pin code. No API keys are necessary to use this SDK.
- The Advanced Mobile SDK for Android provides full fingerprint support, allowing developers to create a unique trust relationship between the user and the application through the use of a secret. Use of this API requires you to become a registered developer with AuthenTec and apply for a special API key for use with your application. It's still free, but there's a review and approval process you must follow to use this SDK.
For the purposes of this beginning tutorial, we will focus on verifying the user's identity matches that of the preconfigured device "owner." That is, the user who can unlock the phone with a swipe of their finger. This will simply require the Mobile SDK for Android.
Setting Up Fingerprint-Reading Support for Your Android Application
To enable fingerprint verification within your application requires a number of steps. You will need to:
- Be developing an existing Android application. Identify the areas within your application that should only be accessible after verifying the user's identity and determine the appropriate code points to drop the fingerprint verification prompt code in to. For the purposes of this tutorial, we created a simple application with two screens. The first screen has a button to trigger an identity check. The second screen is only displayed if the identity is verified.
- Register as a developer at the AuthenTec website.
- Download the Mobile SDK for Android.
- Integrate the SDK into your application project in Eclipse.
- Start using the SDK, adding the appropriate prompts in your app.
- Test on a Motorola ATRIX 4G device that has fingerprint scanning configured properly.
Now let's look at these steps in more detail. We assume you have an existing application that you wish to integrate fingerprint reader support into. However, we have also provided a very simple sample project to illustrate some of the types of statistics that can be easily generated by an Android application. The sample code that accompanies this tutorial is available online in open source form. The code listings you find here are part of this sample project, called CheckPoint.
Register for an AuthenTec Developer Account
The first thing you need to do to get started is to register for a developer account at the AuthenTec developer website. Click the Join Now button and fill out the new account form. It will ask you for your contact information, and prompt you to create a username and password. You must also agree to their terms of service. Once you've completed the registration form, AuthenTec will email you to verify your registration. Check your email, click on the registration verification link, and supply your password. You will then be granted access to the AuthenTec developer program webpage, where you can download the SDKs, read the SDK documentation and access the developer community forums. You can also apply for the Advanced Mobile SDK for Android at this time.
Download the Mobile SDK for Android
From the AuthenTec developer program webpage, you can download the Mobile SDK for Android. It comes as a zip file. Extract the zip. Inside you will find:
- A Readme File
- The tsm.jar file, which is the Mobile SDK for Android JAR file which must be included in your project
- A sample application called TSMVerify (source) as well as an APK directory with the TSMVerify package for review
- A Documents directory containing a PDF entitled "AuthenTec Simple SDK for Android Programmers Manual"
/libs directory within your Android project and save the tsm.jar file within that directory.
Integrate the Mobile SDK for Android into Your Android Project
Next, you need to integrate the SDK into your existing Android project. We're going to assume you're using the popular Eclipse development environment, although using other IDEs should involve very similar steps. To integrate the SDK into your project, you must add the tsm.jar to your project.
Adding the JAR file to your project within Eclipse is easy. Simply follow these steps:
- Click on the Project properties for your Android project.
- Under the Java Build Path settings, select the Libraries tab.
- Click the Add JARs… button and choose the JAR within the
The tsm.jar file should then appear within the Referenced Libraries section of your project files.
Page 1 of 2