Skip to content

sertunc/passport-reader

 
 

Repository files navigation

e-Passport NFC Reader

Get it on Google Play

Android app that uses the NFC chip to communicate with an electronic passport.

Third party apps can use custom intent action to use this app to retrieve passport data.

Custom action id:

  • com.tananaev.passportreader.REQUEST

The following string extras can be set to allow pre-filling of input fields:

  • passportNumber - String
  • dateOfExpiry - String in format YYYY-MM-DD
  • dateOfBirth - String in format YYYY-MM-DD
  • photoAsBase64 - Boolean indicating whether to return photo as base64 encoded image (default false)

Available data keys:

  • firstName - String
  • lastName - String
  • gender - String
  • state - String
  • nationality - String
  • photo - Bitmap (if photoAsBase64 is false)
  • photoBase64 - String (if photoAsBase64 is true)

Usage example:

public class LoginActivity extends AppCompatActivity {

    ...

    private void requestPassportData() {
        Intent intent = new Intent();
        intent.setAction("com.tananaev.passportreader.REQUEST");
        startActivityForResult(intent, 0);
    }

    ...

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            String name = data.getStringExtra("firstName") + " " + data.getStringExtra("lastName");
            ...
        }
    }

    ...

}

For full usage example see "sample" module in the repository.

Contacts

Author - Anton Tananaev (anton.tananaev@gmail.com)

Dependencies

Note that the app includes following third party dependencies:

License

Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

e-Passport NFC Reader Android app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%