Android: detect different magstipe card reader device in one code

278 views Asked by At

I have multiple magstripe card reader devices like:

  1. SS505
  2. SS505 3-track
  3. emag
  4. uniMag

And sdks for each device is different for detecting the device.

So how am I suppose to integrate the code in one for all the devices?

And also How can I get data after card has been swiped onto device?

Is there any way to detect any of the plugged device by same code?

1

There are 1 answers

0
Frackinfrell On

Every card reader is different and the devices themselves are very hard to differentiate, especially audio port readers.

The best and most maintainable solution is to have a separate setup section where the user selects and configures the type of hardware they have. They select the reader they have from a drop down or list, then you keep it in their preferences. From then on, you know what path to take and which library or method to use when detecting and reading the device.

I've tried in the past to integrate all device detection in one place and it quickly became unmanageable. The same goes for a universal swipe page that incorporated all readers into one. It did not work because there are just too many differences, too much poor version control, and they do not play nice together. User selection solved all of those problems for me. Good luck.