Android device connection with server
<p>I am developing a application in which the device scans QR code. The qrcode contains id and some textual information. Based upon some specific information some button gets highlighted. When user clicks on that button the qrcode id is stored in json and and then the connection is made to the server. The server decodes this information and then put some information into jason and send back to the device......and device again decode that information. The server application is to be written in struts 2 . 
           Now my question is how should i write the connection establishment between the device and server.</p>
