Fidesmo Nordpol


Source link: https://github.com/fidesmo/nordpol

Fidesmo Nordpol - The Android Support Library for NFC

Goal of the project

To make it as easy as possible to communicate with a NFC device using ISO 14443-4 commands. Specifically we are targeting devices that communicates using ISO 7816-4 APDUs.

Rationale

Communicating with NFC devices using Android can sometimes be a bit challenging. There is both the new reader mode and the old intent based method. When doing real processing on the card, timeouts starts being an issue and several of the default values require some tweaking. On top of this, on some devices the NFC implementation require some quirks to work properly. We have gathered up our experience from several years of working with NFC on the Android platform into this library.

Usage

To include Nordpol into your gradle Android build add these imports to your build.gradle:

repositories {

  ...
  jcenter() 
}
 dependencies {

  ...
  //Nordpol
  compile 'com.fidesmo:nordpol-android:{
 INSERT VERSION HERE 
}
' 
}
 

If you are using proguard, it will remove methods internal to Nordpol which are called by the android system when a card is detected. To alleviate this please add the following to your proguard configuration:

# The Nordpol library contains methods that will be invoked by the # system and will therefore be removed by proguard. This forces # proguard to keep those methods. -keep class nordpol.** {
 *; 
}
 

You will also be warned that Nordpol uses classes if you are supporting pre 4.4 devices. The library detects the platform version use the right methods internally. Add the following to ignore those warnings:

# The Nordpol library contains references to newer platform versions. # Don't warn about those in case this app is linking against an older # platform version.  We know about them, and they are safe. -dontwarn nordpol.android.** 

API Documentation

There are two tutorials introducing the Nordpol API. The first and simplest one is part of a bigger suite of tutorials on how to program for the Fidesmo Card. The second one is slightly more advanced and shows how to interact with an OTP device.

Building locally

Tools

We use SBT for building. Get it here

The android subproject expects a local.properties file that points to the Android SDK. So to build you need to create the file android/local.properties (relative to the root directory of the repository) containing the following:

On UNIX

sdk.dir = /path/to/android/sdk 

On Windows

sdk.dir = Z:\\path\to\android\sdk 

Building

After cloning the Nordpol project open a terminal in the project folder and run the SBT command sbt publishM2 This command will (locally) publish the library with the version declared in the version.sbt file in the project folder.

Add mavenLocal() to the repository configuration section in your Android project build.gradle file, like so:

repositories {

  /***

* Other repositories

**/
  mavenLocal() 
}
 

Import the latest SNAPSHOT version of Nordpol (or whatever version name you gave your locally published the project). For example like this:

compile 'com.fidesmo:nordpol-android:0.1.20-SNAPSHOT' 

Many operating systems run into caching issues when you try to publish a new version with the same name as the last version. The project might simply fetch the same version as the one it fetched before because the name didn't change. The current suggested workaround for this is changing the version name after each change.

Releasing

If you have the right credentials all that is needed is running the SBT command sbt release and you'll be guided through the process.

Contributions

Additions, bugfixes and issues are very welcome. Added code should be formatted and structured according to Googles styleguide. A pull request should pass the Travis CI before it is merged. If possible a pull request should be rebased to the most recent master commit. Don't forget to add yourself to the list of contributors below.

Thanks for your contributions:

Resources

A smooth and silky signature pad for android.

Verso - Offline Reverse Geocode.

Helper classes to build Android Apps through MVP pattern in a faster way.

A cool dynamic view library.

An image loading View.

This library allows to hide keyboard automatically.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes