我想将我的wifi打印机连接到我的Android设备并使用打印机管理器打印pdf . 我在谷歌搜索了很多,虽然有很多问题像我的但我没有任何解决方案 . 我的打印机不是 Cloud 就绪打印机 . 请帮忙 . 谢谢... !!
我假设您尝试使用打印管理器打印自定义文档 .
给出print cmd的时间会出现一个对话框,说明无限期地搜索“打印机” .
从打印机提供测试文档打印,您将获得连接到打印机所需的信息 .
你要做的就是从Play商店下载你的打印机的“Plug-in” .
下载后,您需要打开它并使用测试文档打印中的凭据连接到打印机 .
现在尝试从您的应用程序打印文档 .
private void connect(BluetoothDevice device){
//try to make a "Bond" if possible. Else return if (device.getBondState() == BluetoothDevice.BOND_NONE) { try { createBond(device); } catch (Exception e) { showToast("Failed to pair device"); return; } }
private void createBond(BluetoothDevice device)抛出异常{
try { Class<?> cl = Class.forName("android.bluetooth.BluetoothDevice"); Class<?>[] par = {}; Method method = cl.getMethod("createBond", par); method.invoke(device); } catch (Exception e) { e.printStackTrace(); throw e; } }
2 回答
我假设您尝试使用打印管理器打印自定义文档 .
给出print cmd的时间会出现一个对话框,说明无限期地搜索“打印机” .
从打印机提供测试文档打印,您将获得连接到打印机所需的信息 .
你要做的就是从Play商店下载你的打印机的“Plug-in” .
下载后,您需要打开它并使用测试文档打印中的凭据连接到打印机 .
现在尝试从您的应用程序打印文档 .
private void connect(BluetoothDevice device){
private void createBond(BluetoothDevice device)抛出异常{