Sunday, 15 July 2012

printing - How to give print command to printer from Android app? -


I created a simple app in which I print print command on the printer but nothing happens.

Here's my code:

  New thread (new runleball) {@Override Public Zero () {// TODO auto generated method stub socket socket, {socket} = New socket ("xxx .xxx.xx.21", 515); Printwater outputstream = new printritter (socket.getoutputstream ()); Outputstream.printLN ("\ f this is a test print"); Outputstream.clos (); Socket.clos (); } Hold (UnknownHostException E) {// Todo Auto-Generate Catch Block E.Pintstaxtress ();} Catch (IOE EXPRESS E) {// Tudo Auto-Generated Catch Block e.printStackTrace ();}}}) ;  

When I run this code it works but does not print anything on the printer.

Configuration details:

I have a laptop, Android device & amp; In the same network printer I tested all 3 as well as the IP address of the printer's port number In addition, I ping my laptop at the command prompt from the printer's IP address, so I get the answer, but when I connect to the device, then nothing happens.


No comments:

Post a Comment