Although I’m generally not excited when I see a parking inspector on the side of the road, the technology nerd in me does always look around to see what gadgets they are using. Gone are the days of a notepad and pencil, instead they usually have an all-in-one device, or a phone with a printer hanging on their belt, to print out the tickets.
Keen viewers of the AppStudio 4.2 highlights video would have caught a glimpse of one of our newest samples - Print Location. This sample shows how your app can connect to a bluetooth printer, display a print preview, and send a print job directly to the paired printer. So, although you might not be designing a parking inspector app, you can now add the ability to print information from your app on the spot: a receipt of services completed, or evidence of data entered in the app.
The printer used in the highlights video is a Zebra iMZ220. We’ve tested this printer on all our supported platforms and have had it whitelisted in AppStudio Player on iOS so you can use it on your iPhone or iPad, as well and Android, Windows, Mac and Ubuntu. Other printers can work in a similar way, and might only need a little tweaking of this current app. This app has not been designed specifically for, or tested with other printers, but can be used as a starting point for your own awesome app that prints to a bluetooth printer.
Explore the Print Location sample
The Print Location app is available in AppStudio for you to use as a sample. Of course, to fully test this app you will need a printer, but even if you do not have one, you can try out the print preview and get an idea of how you can use it.
There are three tools in this app:
The Settings tool will be familiar to anyone who has worked with our GNSS Discover sample or any of apps that connect to a bluetooth GNSS receiver. The concept here is the same. You first pair the bluetooth accessory with the device, the app needs to then identify that paired device, and then once identified it can send or receive information to or from it.
The Print Preview demonstrates what information will be sent to the printer. In this sample, see how there is a combination of things that were visible in the app – ie: the map – and things that were visible ie: the coordinates and time stamp. You choose what to print out independently of what is shown on the screen.
The Print tool is self-explanatory. Whatever is shown in the print preview, is what is sent to the printer when you click Print.
Things to consider
When you do this, you will see that all paired Bluetooth devices will appear in the list. There isn’t a standard device type that can be used to filter for only printers, so once you get your app working with your printer, think of a good name filter to use to hide the noise of all possible pair devices.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.