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
Related
Does Android have any built-in communication APIs that lets a native Android app running on a phone communicate with a native Android app running on Android TV? The only solution I can think of is where the Android TV app creates a socket and the client app on the phone would connect to this socket.
EDIT:
I'm looking for a solution where no user interaction is required to setup the communication. Bluetooth requires the user to pair devices. NFC requires being very close to the device.
Yep, I implemented this by two ways, since P2P is disable on a lot of Android TVs, I kept socket and firebase solution, both works:
for socket purpose:
https://jayrambhia.com/blog/android-wireless-connection-1
For firebase, I did a page where the firebasetoken is display in a QRCode, the mobile app scan it, and we send a notification with the auth params to the Android TV App wich can connect to our back end.
Does Android have any built-in communication APIs that lets a native Android app running on a phone communicate with a native Android app running on Android TV?
You have the same options that you with any pair of Android devices:
Direct ordinary sockets, if the two devices happen to be on the same WiFi LAN segment or are otherwise directly reachable, and you are comfortable with the security ramifications of having an open socket connection
WiFi Direct (where available)
Bluetooth
Indirect communication through Internet-hosted facilities (e.g., FCM) or possibly some locally-reachable server that is not on the Internet (e.g., WebRTC)
NFC, though probably few Android TV devices have NFC support
About the only thing that I can think of that might be more unique for Android TV would be those that offer an infrared (IR) receiver, but I have no idea how much apps can tap into that, and few Android devices have an IR transmitter.
There is a guide from the android developer website
https://developer.android.com/training/connect-devices-wirelessly
Network service discovery (NSD)
P2P connections with Wi-Fi Direct
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).
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
I want to make my android device working as a bluetooth headset.
I search the Android APIs, but I just find some interface which
can make Android device working as a masters, not as a device(bluetooth headset).
I'm also ready to modify the source codes of Android OS, and rebuild the OS.
What I hope is, when Android devices connect to a mobile phone with bluetooth, the Android devices can work as a bluetooth headset.
I don't know whether there are interfaces can do this, or I should modify the Android OS?
Thank you!
You need to implement HFP profile in your android device, normally phone role is AG(Audio gateway) and headset roles is HF(Hands free) , think its as a server and client role. Connect RFCOMM channel to phone using UUID defined for HF , have SDP record updated,changes will be required to handle AT Commands as well.
These will be the initial changes, once done you will need to handle audio packets(SCO packets) for voice calls
I am quite new with Bluetooth communication using Android. I want to develop a sample project that is to ON and OFF different LEDs via Bluetooth by using Android phone, for this I would need a Bluetooth module to communicate with the LEDs.
Now my questions are:
1) What technical specification are required for Bluetooth module to communicate with android phones(I have two android phones having Bluetooth version V2.1 and V3.0)?
2) which company's Bluetooth module would be better for me in the above situation?
Please help me in this respect I would be very thankful to you for this act of kindness. Thanks in advance.
http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html
Use the UUID specified there for SPP
The bluetooth adapter will work as a Server by default.So you should do Client programming on android side.
My project deals with sending data continuously,so I had to use HandlerThreads so that I don't block the UIThread.Since you don't need to send much data you can work directly on UIThread.So connecting as a client section of android documentation will do.