print from php application on a local bluetooth printer - android

I have the web-based application in 'PHP' and 'MYSQL' mobile version. We access application from android device (for example Smartphone). There is a local smart Bluetooth printer pairing with Smartphone. Distributors, who use that application, must take Bluetooth printer on a way, and print a receipt on that printer. Is there any solution for this? Any help or ideas will be appreciated. 2 days I can’t solve this problem. I can replace android device with any Microsoft device (for example "NOKIA LUMIA"), if it gets me any advantage.

It turned out that, the printer attached application, has its own web browser. When I navigate to my site from this browser, I discovered, that it has PRINT menu.
now I'm printing from this browser. I have made the printable version of web page and all is OK!!!!
well done.
My printer model is "MPT-II" (made in china).

Related

BLE Discovering Result different between Windows 10 and Android 6

I'm today in front of a problem with bluetooth and web app.
Introduction
First, here is my goal:
I want to connect a KDC (barcode scanner) in a web application (which will be probably write in C#, ASP.Net Core and JS). You can find the model and characteristic of this scanner here : koamtac.com/wp-content/uploads/KDC300.pdf .
The goal of this project is to use this website mostly on tablet and mobile, and not to use scanner with windows (but we would like to be able to see the website in computer aswell)
Sadly, Koamtac gives a SDK for windows local applications, for Android applications, but not really for web applications...
BLE tool
With this objective in mind, i discovered BLE technologies and the new Web Bluetooth API powered by google : Google Web Bluetooth API Implementations Status.
As you can see, we could use it with windows to discover devices but not to be connect with them. (But with android 6+, it is possible to do both).
This tool seems to be just in line with my project but currently i didn't knew really if my KDC could be use as a BLE device. I decided to make a simple web application where i could test if i saw (or not) the KDC device.
Application
navigator.bluetooth.requestDevice(
{
acceptAllDevices: true,
optionalServices: ['battery_service']
})
.then(device => {
console.log('> Found ' + device.name);
console.log('Connecting to GATT Server...');
return device.gatt.connect();
})
I did it on a github rep to get the HTTPS protocol which is needed to empowered the Web Bluetooth API. You can see this app here : My GitHub Repository
Finally, i tried this application with 3 differents states:
With Windows 10, in local (using Chrome Dev Tool)
With Windows, connected to rlamotte.github.io
With Android 6+ on my smartphone, connected to rlamotte.github.io
Before giving my results, you can see every bluetooth device in range of windows/android on the picture named "Device_In_Range_......" in the Github Rep
Results
I had those results:
In local, KDC device is every time found (see Request_Device_Result_Windows_Local). I can't connect to it (see KDC_connect_Windows) because Windows is not able to connect to GATT.
In this page (see Request_Device_Result_Windows), KDC is found 10% of time, and it takes much time to get it (approx 1 min). As you can see, Request found Gwladys, and 81PRMX1.
(see Request_Device_Result_Android), KDC is never found, and the request found EST (a beacon) and JBL Flip 3 (a bluetooth speaker).
Conclusion:
As you can see, the result of request_device is not the same with windows 10 and android 6. But when we use the bluetooth manager of those device, we saw exactly the same devices (the sum of devices found by each request_device).
I'm new to Bluetooth API area and i don't know why Android doesn't show all bluetooth device with request_device.
THANKS for you help ;)
EDIT #1
It seems that KDC 300 doesn't support BLE. I'm currently searching a way to connect bluetooth classic device to web app. If anyone has an idea you can tell me. If i don't find any powerful way to solve it, i'm gonna try to make an hybrid app android/windows with xamarin to use native bluetooth connection.

How print text from web page on Bixolon mobile printer from android os

description of the problem:
It is necessary to print on mobile printer Bixolon R200II from the mobile device which has operation system Android (V4.*). To be printed information is generated on the webpage, on which we log in from the existing browser ( though it may be Google Chrome) I want to print the information and how can it be performed.
First you have to set the mobile printer connected with your smartphone or tab together via bluetooth. For this yoi should turn on blutooth on Android and turn on your printer. Then press scan to search & find your mobile printer then click on the name that apperar on tablet and it ask you pin (its maybe 0000 or 1234 as a default) then tap ok button ..
Go to the webpage and send it to mobile printer it search to find it and then click print.

Working With Bluetooth printer Device

In my project need to search Bluetooth printer device and pared it and send text to printer
There is any API is available to search Bluetooth device and Pared and Sent text to particular
Device.
Your questions:
is any API is available to search Bluetooth device ?
Please refer to this.
There are lot of API available on Google Play. Personally, I like BlueSerial. Also you can use BluetoothChat sample code, it works too.
Upload BluetoothChat sample codes to the device using Eclipse or Android studio
Pair them
Open BluetoothChat sample app
Connect to BT device

How to get the PrinterDiscoverySession when using the printer in android 4.4

I am recently using the Printing Framework in Android 4.4, now I have a demand to get the printer's information which can be used in the Mobile phone or tablet.
I found the PrinterDiscoverySession class contains the printer's information. But how can I get the instance of the PrinterDiscoverySession class?
Seems like the Android printing API hides the printer details to the regular apps. Only a PrintService has this knowledge, but a PrintService is made to let other apps print: it doesn't print anything by itself - it's like a printer driver in the PC world.
The PrinterDiscoverySession is an abstract class implemented by a PrintService; it tells the PrintService when it's time to scan for the available printers in the network (wifi, bluetooth, cable, this is up to the PrintService implementation) and to report back the list of printers found. This list is only used by Android and its system activities, but never (AFAIK) shared with the apps.

Bluetooth printer compatible with android

I have to Develop an billing application for android devices.On the application there must be a provision for print the invoices using any bluetooth/Wifi printer.But upon my knowledge android doesnot support printing via Printer.is there any way or any tutorial upon it?
You don't have to print it using a standard printer driver,you just need to write bytes to a Bluetooth enabled printer,for testing our Bluetooth apps we usually make use of a printer which has a Bluetooth facility. You need to refer Bluetooth server socket http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html

Categories

Resources