Minor change to Android/React Native Printing Package
Budget: $50 – $100 USD
We are using the below printer library for React Native on android devices and want to do two minor changes.
1. Currently it only supports maximum one printer connection at a time since it uses singleton pattern. We want to change this so that you can have multiple printers connected at the same time.
https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr
You should be able to achieve this quite easily by changing the NetPrinterAdapter file to not use singleton pattern.
https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr/blob/main/android/src/main/java/com/pinmi/react/printer/adapter/NetPrinterAdapter.java
2. The method that makes the connection to the printer (selectDevice) in NetPrinterAdapter file does not use any thread and does not ping the printer first which causes it to block the main thread if the printer for example is not available for connection.
So hence we should change this method to do the logic inside a thread instead and also ping the printer with a timeout before making the connection. Or adding a timeout to the connection.
We can test the changes together if you do not have any access to a printer.
Kindly write "ANDROID PRINTER" on top of your offer so that I know that you have read the description.
1. Currently it only supports maximum one printer connection at a time since it uses singleton pattern. We want to change this so that you can have multiple printers connected at the same time.
https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr
You should be able to achieve this quite easily by changing the NetPrinterAdapter file to not use singleton pattern.
https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr/blob/main/android/src/main/java/com/pinmi/react/printer/adapter/NetPrinterAdapter.java
2. The method that makes the connection to the printer (selectDevice) in NetPrinterAdapter file does not use any thread and does not ping the printer first which causes it to block the main thread if the printer for example is not available for connection.
So hence we should change this method to do the logic inside a thread instead and also ping the printer with a timeout before making the connection. Or adding a timeout to the connection.
We can test the changes together if you do not have any access to a printer.
Kindly write "ANDROID PRINTER" on top of your offer so that I know that you have read the description.
Related categories:
Business, Accounting, Human Resources & Legal
Mobile App Development
Android
React Native