Android and servlet

I want to upload image to server using HttpUrlconnection in android and want to received by a servlet and print on the servlet page.I want complete code for android as well as servlet.