1 Reply Latest reply on Dec 19, 2017 12:14 PM by Matthew Belk

    Discover paired printers

    tasos grigoris

      I'm following the ZSDK_DemosAndroid project to discover bluetooth paired Zebra Printer's so as to get their mac address.My code for this runs on my main Activity and is like this,


      new Thread(() -> {


         try {


      BluetoothDiscoverer.findPrinters(this, new DiscoveryHandler() {


         public void foundPrinter(DiscoveredPrinter discoveredPrinter) {  runOnUiThread(() -> System.out.println("FOUND PRINTER " + discoveredPrinter));}


         public void discoveryFinished() {runOnUiThread(() -> System.out.println("FINISHED DISCOVER"));}


         public void discoveryError(String s) {}



        } catch (ConnectionException e) {e.printStackTrace();} finally {Looper.myLooper().quit();}



      Although i do have a paired printer, foundPrinter() never runs but discoveryFinished() does.Thus i don't get the connected Printer.Could this be permission-related?I've already set the following permissions in my manifest though.


      <uses-permission android:name="android.permission.BLUETOOTH" />

      <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />