-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Bluetooth support, SDK updates (testers needed) #42
base: master
Are you sure you want to change the base?
Conversation
…tPrinter, and printerStatus methods
Hey @gordol, I want to test the Bluetooth printer PT-P710BT on this branch with the SDK with version You commented: "Looks to me like y'all don't have the Brother Android SDK installed properly, as that library is included with it. Otherwise, it doesn't match your architecture... Either way, it's not an issue with this Cordova extension." Can you point me in a direction how to "add the libraries manually"? |
@ykrasnokutskiy can you tell me how to "add the libraries manually"? Then you would be my hero. |
you should have a directory like that in your project. if you don't, you need to move these files from the SDK so they can be found by the linker. |
Thank you very much, that helped! The printer that i used isn't compatible with the SDK however. |
@koktaildotcom do you need a newer SDK for it to work? or is it just not compatible at all? |
I've used the Brother PT-P710BT, and that printer not compatible with the SDK. |
.so files are not recognized by gradle / android when simply put in the "libs/" folder. According to https://stackoverflow.com/questions/24357687/how-to-include-so-library-in-android-studio, this can be fixed by adding these files to the app/src/main/jniLibs directory.
* Add a method "setLabelInfo" that can be used to configure the paper type. If no label type is configured, the print fails with "ERROR_WRONG_LABEL" * Properly set printer's MAC address when connecting to the printer in bluetooth. The printer can't be found otherwise
Hi @gordol , I tried using your branch to print on a QL-820NWB connected via Bluetooth (I'm still testing for wifi). The first issue I ran into was the android system not being able to find
After some research, I came accross this stackoverflow which advises putting .so files in app/src/main/jniLibs. I did it in stevenremot@088e14f. This solved the issue for me. Then, when calling the Lastly, when the printer was found and the print order was sent, I got an error I implemented a draft of API to set some label information before printing. This and the bluetooth fix were done in stevenremot@6dd9d11 |
Properly set ipAddress in order for the SDK to be able to find the printer on wifi infrastructure.
I succeeded in printing with the QL-820NWB in wifi infrastructure mode. I had to update the way the ip address was set though: stevenremot@3585abc |
@stevenremot thanks for the updates. yeah, this SDK is a bit tedious, and there's not a simple solution for every printer, it takes a little tweaking between models apparently. we might be able to build out some scaffolding with the various configurations for each model, but we need testers to do that. :) thanks for your help. |
@stevenremot pull requests are welcomed btw |
I'm totally willing to open a PR with my changes. However, my branch is based on this PR, so I wasn't sure about what to do... Should I open a PR to replace yours ? |
Hmm... can we merge into this one? Or are there conflicts... I haven't looked. |
Brother SDK updates
There ya go, I merged it all in. |
Yay thanks a lot! |
What do you need for this PR to be merged ? More testers ? |
I wasn't quite happy with the state of the dev branch (lots of people have touched it, etc...) I shouldn't have accepted one of the merges for Bluetooth support because it's pulling classes from Brother's demo app, instead of relying on documentation from the SDK manual. I've taken the good bits from the dev branch, where Android is concerned, and have cleaned it up a bit.
Unfortunately, I do not have a bluetooth label printer, so I cannot test this. @ykrasnokutskiy can you give this a shot and see if it works for you? It compiles fine, but there could be runtime errors.
If someone wants to send me the funds for a QL-820NWB, I'm happy to try to get it working (if it's not working already).