Sorry, I don't use Xamarin, and that is not really the solution; if you find another sample and that one does not work, what then? If you aspire to be a developer then you really need to practice diagnosing problems, even if you need help solving them.
I have tried to explain how: you use your debugger to step through the code and look to see what variable is not being set up correctly. You can only solve it by collecting all the information around the time of error.
I want to add a method by which I can directly print report from the printer on local network.
my server which printer is connected to is 192.168.1.50
(my printer isnt Bluetooth OR Wifi one.)
I also have seen PrinterShare but it looks like it requires a client software running on a PC connected to the printer.
I wanna to do it directly to server which has printer connected and shared!
I got this code but no USE!!!
I wanna to do that in (xamarin C#)
Socket sock = new Socket("192.168.1.222", 9100);
PrintWriter oStream = new PrintWriter(sock.getOutputStream());
oStream.println("HI,test from Android Device");
catch (UnknownHostException e)
catch (IOException e)