7

I am working on an app in which there is an option to print the badges. Currently I am using BrotherPrinterSDK but it will restrict the functionality for Brother Printers only.

Can anyone help me with a demo to find a list of nearby wifi printers and print by selecting any one of them?

Moreover Brother Printer SDK is not working properly in the versions above marshmallow. So I want to switch to some other method

Kartika Vij
  • 203
  • 3
  • 17
  • Did you read [this](https://stackoverflow.com/questions/4656199/bluetooth-and-wifi-printing-for-android)? See if it could be of any help. – shadowsheep Mar 19 '19 at 17:24

3 Answers3

3

Mopria Alliance is an open system for printing to wi-fi and networked printers. How to Print with Mopria Their driver (which is an app) is Here

In your app, on startup, you can check if Mopria is installed, and send them to the Mopria App, if not.

In your app, add a "Print" menu option or button, and have it open the Mopria Printers tab, which will search for local devices. Your app will likely want permissions to turn on Wi-Fi if it is not on (this doesn't sound like a problem from your description).

I did some testing on this a couple years ago, so I will look for some demo code when I get home.

  • I dont want my printing to be dependent on some other app – Kartika Vij Mar 20 '19 at 05:44
  • I understand being dependent on another app; in that case, you basically have to write a "Universal Print Driver", which is what Mopria did. I understood your question to say you had an Issue with Brother (which we did too), not Printer Driver Apps in general. We settled on (and suggested customers use) several models of laser printer and we used Mopria. It was simply faster to develop and release our product. – FederOnline Mar 20 '19 at 17:18
1

Best option so far is using Google cloud printing

so no need relay on other third party apps, but user must add there printer with his own google id

ref:https://www.google.com/cloudprint/learn/index.html

As mention here https://www.google.com/cloudprint/learn/printers/ they support wide range of printers,

To make it programmatically check https://developers.google.com/cloud-print/docs/android

UdayaLakmal
  • 4,035
  • 4
  • 29
  • 40
0

In my experience when using a Wi-Fi printer you should use the specific SDK provided by printer's manufactures. It's easy and prints faster than any other app dependent SDK. In case SDK is not working may be because of some permissions that you need to ask on run time as Android 6 and above need user to accept some permissions like Contact, SMS etc. you can look here for that.