Following an Android fingerprint scan through RxFingerPrinter
An Android library that wraps fingerprint authentication in RxJava, handles lifecycle binding, and includes a fingerprint UI component.
At a glance
- What is it?
- RxFingerPrinter turns Android fingerprint callbacks into RxJava 2 events. Its sample app shows who starts the scan, who stops listening when a screen pauses, and which results the screen can display.
- Who is it for?
- RxFingerPrinter is most useful for maintainers reading existing Android fingerprint code. For a new implementation, compare the platform biometric prompt first.
- Can I use it commercially?
- The repository metadata does not identify a licence. Check the project’s published terms and any component-specific licences before reuse.
- Is it still maintained?
- Yes. The repository last received commits 80 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Editorial analysis
A button starts recognition in the sample activity
The sample puts a fingerprint view and a button on the same screen. When MainActivity is created, it constructs an RxFingerPrinter with the activity as its argument. Pressing the button disables it, creates a new observer and starts recognition. That sequence gives a maintainer two places to look when a tap produces no visible change. The button listener starts the attempt, and the observer is responsible for telling the view what happened. The application supplies the view itself. The library supplies the fingerprint event that its code interprets.
The call at the end of the button handler is short enough to hide the division of work.
rxfingerPrinter.begin().subscribe(observer);In the library source, begin creates a PublishSubject and returns the wrapper. The subscribe method attaches the observer, checks the Android version and, on a supported version, prepares the system manager. Seeing the button become disabled only establishes that the handler ran. The screen still needs an event from the following steps to report a match or explain why scanning could not start.
A build minimum and a fingerprint minimum
The README recommends an Android 6.0 device with a fingerprint module. The library build file declares a minimum SDK of 15, compiles against SDK 25 and targets SDK 25. Those numbers answer different questions. A package that declares an early minimum can contain a branch for older devices. It cannot make fingerprint hardware or the corresponding system service appear on them. The subscribe method sends an error value to the observer when the system API level is below 23.
On a newer device, the wrapper consults Android about permission, detected hardware, secure keyguard configuration and enrolled fingerprints. A phone with a reader can therefore reach a different result from a phone with both a reader and an enrolled finger. The secure lock screen is another distinct prerequisite. This is useful when reproducing an old issue reported simply as a failed scan. Record the Android version and those device conditions before treating every report as an unrecognised finger.
What the observer receives after a touch
IdentificationInfo has a success flag and an optional FPerException. One constructor accepts a boolean. Another accepts an exception code, creates the exception and sets success to false. In the sample, onNext reads the success flag first. The application can obtain a code from the exception for its own handling or call getDisplayMessage for the corresponding default message. The messages shown in the README are in Chinese. An application with translated screens has a reason to keep the code and its user-facing wording separate.
The system callback for a successful match emits a successful IdentificationInfo. An ordinary recognition failure produces an unsuccessful event. A system authentication error follows a different branch that also cancels the current signal. An application waiting only for the observer's onError method would miss the ordinary failure information carried by onNext. The result object has no field for a fingerprint image or the identity of the finger that touched the reader. A screen can report a match without making either of those claims.
Why pausing the screen changes the next scan
RxFingerPrinter looks for a tagged fragment in the activity's FragmentManager. When it creates the fragment, it registers itself as a lifecycle listener. The fragment forwards its pause, resume and destroy events to a lifecycle object. That gives the wrapper a place to cancel an in-progress scan when a user temporarily leaves the screen. The cancellation signal belongs to the listening attempt. The observer belongs to the Rx subscription, which has a separate cleanup path.
On resume the wrapper checks its completion flag before attempting to listen again. A successful scan sets the flag. So does the system error branch that cancels the signal. This explains why expecting every return to the screen to create a fresh attempt can give the wrong result. The sample uses its button to create an observer for a new attempt. When assessing an existing integration, distinguish leaving the screen during a pending scan from leaving after the application already received a successful result.
The Gradle example identifies a historical dependency
The README places the following declaration in the application's module dependencies. It names the artifact and release used by the example.
compile 'com.zwh:RxFingerPrinter:1.2.1'The library's publishing block names the same group, artifact and publish version. Its Android default configuration separately gives the module a versionName of 1.0. These fields have different consumers. The publishing block identifies the version in the README dependency coordinate. The module's build also declares RxJava 2.1.1, RxAndroid 2.0.1 and the Android support library. The README uses jcenter for resolution and links to Bintray. That historical declaration provides no confirmation that a clean checkout can resolve the binary from that repository today.
The publication configuration identifies Apache-2.0 and the README includes the Apache version 2 notice. For a team examining an old application's dependency, these files provide better evidence about the intended artifact and licence than the absence of a GitHub release entry. Before planning a rebuild, the team can check which binary its existing build actually used.
A cleanup check before reusing the wrapper
The library keeps observers in a CompositeDisposable. Both begin and the destroy callback call the wrapper's dispose method, but the method only invokes dispose on the collection when its isDisposed check already returns true. Reading that condition gives a maintainer a specific reason to verify observer lifetime across repeated button presses and activity destruction. Calling a method named dispose does not by itself establish that a previously live subscription was disposed.
For someone maintaining a screen built around Android's FingerprintManager, the event object and sample activity make the original flow readable. A new application has another option in Android's biometric prompt, which puts the user-facing authentication prompt under the platform API. A team choosing between those paths should decide which code will own the prompt, which system versions it supports and what action a successful authentication is meant to authorise. This wrapper's sample demonstrates a change to the view on a successful callback. That is the behavior the sample actually supplies.
Editorial conclusion
RxFingerPrinter is most useful for maintainers reading existing Android fingerprint code. For a new implementation, compare the platform biometric prompt first. For an old one, verify observer cleanup and the response to a paused screen before reusing the sample.
Frequently asked questions
Which Android version does RxFingerPrinter require for scanning?
The wrapper checks for API level 23 before initializing fingerprint recognition. The README recommends Android 6.0 or newer with fingerprint hardware. The library module declares a lower packaging minimum of API 15.
Where does an unsuccessful fingerprint attempt appear?
The wrapper sends an IdentificationInfo to onNext. Check isSuccessful and inspect the FPerException on an unsuccessful result for the code or the default display message.
Does a scan always restart when the screen resumes?
The pause callback cancels the listening signal. The resume callback starts listening only when the wrapper has not marked the preceding attempt complete.
Official sources
- app/src/main/java/com/zwh/rxfingerprinter/MainActivity.java
- lib/build.gradle
- lib/src/main/java/zwh/com/lib/IdentificationInfo.java
- lib/src/main/java/zwh/com/lib/lifecycle/SupportFingerPrinterManagerFragment.java
- lib/src/main/java/zwh/com/lib/RxFingerPrinter.java
- Official README
- Project repository
- README.md
Was this useful?