Im currently developing an app for a handheld device, running Android OS and with a built-in termal printer. The app will be used for selling and ticketing. Now, boss ordered a few POS for testing (from China) and, well, shipping takes forever to get here so im doing some research in terms on how the "printing" part works. As of right now, what im doing is storing the tickets inside the sdcard and then i download the file to my pc and print it using my TSP700 desktop printer. My question is.. when it comes to printing on the built-in printer, is it possible to send the file that's supposed to be printed right to the printing queue without having to store a copy of it in the sdcard? Anyone with experience on this kind of situation?
In a word, yes. There isn't any reason for the SD card to be involved at all. I've used receipt printers that are connected via Bluetooth. Since yours is built in, it's likely to be USB. Hopefully the manufacturer publishes a well-documented SDK for the printer, but don't count on it. I had to write my own frame-based serial protocols and receipt formatters. There's probably not a printing queue unless you write one.
How your app can communicate with the built-in printer depends on the manufacturer’s implementation. I would start by finding out from the manufacturer what interface is available to your app and any SDK or samples they offer to integrate printing into your app.
Related
I am new to using the RPi and just got the A+ model which I have been using to generate different types of data from external sensors. I was wondering if it is possible to send this data it is gathering to an android device in real-time, and if so the best method? I want to be able to notify the user (through a an app made with the Ionic framework) when the data enters a particular range etc.
And also is it possible to do this whilst the user is walking around with both the devices in hand?
The short answer to the question is: Yes, you can ;-)
The longer answer is much longer, since there are many ways to do this.
The one I personally would choose as the simplest is classic Bluetooth (not LE) using the SPP profile, which basically makes the BT link a serial connection between the RPi and the phone.
On this serial link you invent you own streaming protocol suitable for the data you want to transfer.
On the RPi side you install a module such as this: https://www.sparkfun.com/products/12577
(There are many alternatives, but the RN42 module is very foolproof...)
Don't know the level of your hardware skills, you might need something more plug and play if you feel uncomfortable hooking up the 4 wires needed for 3.3V power and serial communications between the Pi and the BT Module...
On the phone side you install https://github.com/don/BluetoothSerial, which gives you an API reachable from Ionic where you can receive the BT data stream.
With that and a bit of coding on both sides you are good to go.
I've used a Raspberry Pi in combination with an Android smartphone & Lego NXT.
Communication was achieved using Bluetooth on Raspbian. I used a cheap $1 USB Bluetooth dongle. The Bluetooth stack had to be compiled for Raspi, which may not be necessary anymore. Steps can be found here: Bluetooth error: Native Library bluecove_arm not available
Bluetooth seems most logical to me.
I'm at work at the moment, hence the lightweight answer, if you'd like to discuss this further then please leave a comment and I'll be happy to provide more verbose response.
You can upload the data to any cloud services. You can use Xively/Box. Xively is specially made for real time data collection.
To connect RPi to Xively, refer this: https://xively.com/dev/tutorials/pi/
For Box, refer this: http://www.sbprojects.com/projects/raspberrypi/webdav.php
You can then use Xively API in your android app. You can see GitHub for this
Google app store already has some apps for you, if you want to use
It might look a little complex. But its really simple once you follow the above methods.
I am interested to develop bluetooth printer app for Android so please guide me how to begin
it?
Is there any free third party library for that ?
Star Micronics has an SDK for Android printing via Bluetooth (as well as ethernet, wifi, and USB). You can download it here: http://www.starmicronics.com/support/SDKDocumentation.aspx.
You can't print natively from Android at this point in time so the alternate solutions are a 3rd party API, finding a 3rd party printing app, or writing your own printer support.
In my experience, it's best to use an API and not an external app. The biggest reason is you get total control over printer behavior. Using an external app is limiting because you can't customize your print outs the way you want to. Writing a printer driver is too hard because you need to intimately know the device for perfect support... the API gives you full control over the device without all the frustration of re-engineering the whole process.
The Star SDK I linked you to has an API and a really nice sample app that lets you test and customized printer functions to see them in action. It's well documented too.
If you choose this way, you can send plain text to the printer along with commands. The API handles converting the data into what the printer can understand.
hi im trying to make a POS app for android using adobe air mobile .
i have an epson thermal printer connected to a Wifi router.
i have learned that printjob won't work with the mobile apps
Please give me some solution for this
I have seen people go about this in three different ways:
Use an API from a printer manufacturer
Use a 3rd party printing app
Write your own driver
From experience, #1 is by far the best option. It's much better to use an API because it allows you full customization over print outs (font, special device commands, etc) and it reduces the amount of time you need to spend researching and coding.
3rd party printing apps are limited in customization. They might be good for a full size office or home printer, but POS printing usually has more specific requirements and often needs a level of customization these apps can't offer. Writing a driver is hard because there are so many things you need to intimately know about the printer: how to establish communication, get status, format the receipt, and more. It's like spending months to reinvent the wheel because a well-constructed API handles all of this for you.
I highly recommend you check out Star printers. They have a great Android SDK with a printing API that's full of samples and it's heavily documented. http://www.starmicronics.com/support/sdkdocumentation.aspx
After pairing with a phone via bluetooth, is it possible to access the sd card contents (like music or images)?
Are there any tutorials or sample code for this?
i see an application named "Bluetooth File Transfer" and want to make another like that i read about bluetooth, bluetooth socket but not found any thing useful how to perform that operation i am researching more if i found i will post here the solution if anyone found soon then please post here.... Thanks
Sure it is possible. But you need to know:
Which Bluetooth protocol you want to use? Some of them are here:
Bluetooth protocols
How big data you are willing to share between, because if you have big
data then you need to use some other connection.
You need to know
how to secure data, Bluetooth is very vulnerable.
And you can tell us what you want to do? You are programmer or just asking? If so use link as suggested in your comments.
EDIT:
Here is for example some examples in QT programming language, which I use for developing apps for Android: http://www.developer.nokia.com/Community/Wiki/QBluetooth_-_A_Qt_bluetooth_library
There was a way in early 2000s with Ericsson and Siemens phones with OBEX protocol, and a user file system.
In windows XP with Toshiba stack you had to assign a virtual COM port to a bluetooth device, and install the original phone software, with its RS232 interface IO drivers.
After that you could browse your phone using OBEX tools, or as a disk device, it there was a driver.
If you want to open sd-card and phone storage of any phone using android, then you can follow the following method:
Open your android settings.
Now open bluetooth settings.
Activate your bluetooth.
Search for devices.
Pair the bluetooth device.
Now you will be able to see a setting sign on right side of name of bluetooth device.
Touch that sign. You will now see a file transfer box then ftp client will open and you can open the other phone's storage.
I am developing an application for Android Tablet,now in my application if i select print option then data should be print in the Bluetooth printer.to achieve this first i want to know how to recognize nearest Bluetooth devices and also how to print data in a Bluetooth printer.
Have you looked at any of the Android Bluetooth Documentation?
Star Micronics has an SDK for Android printing via Bluetooth (as well as ethernet and USB). You can download it here: http://www.starmicronics.com/support/SDKDocumentation.aspx.
At this point in time, the Android OS doesn't support native printing over Bluetooth.
In my experience, it's best to use an API and not an external application. The biggest reason is you get total control over printer behavior. It's easy too if the API is built intelligently. Using an external app is limiting because you can't customize your print outs the way you want to.
The Star SDK I linked you to has a really nice sample app that lets you test and customize a lot of printer functions to see them in action. Each function is documented in the source code. The commands and their parameters are also available in the app itself as a quick on screen reference which is convenient. On top of all that, it's well documented.
If you choose this way, you can send plain text to the printer along with commands. The API handles converting the data into what the printer can understand.