Browse DevX
Sign up for e-mail newsletters from DevX


Sending HTTP Requests from a Wireless J2ME Device

Learn to use the J2ME networking classes found in the javax.microedition.io package to send HTTP requests to a Web server or similar HTTP-enabled network server.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

s more and more cellular phones and PDAs begin to merge onto the information superhighway, it becomes increasingly interesting to access Web sites from mobile devices. Since Java was initially created for consumer appliances with a small memory footprint, it is the perfect language for developing applications for phones, pagers, and other micro devices.

In this 10-Minute Solution, we will learn how to send an HTTP GET request and an HTTP POST request to a server from a J2ME client. Although this is a rather introductory discussion, it is assumed that the reader is accustomed to working with Java, J2ME, and Java midlets (MIDP applications). We will use the MIDP profile for J2ME and compile, deploy, and test our application using Sun's J2ME Wireless Toolkit. For the HTTP server, any WWW address may be accessed, but by default we will use a simple Java servlet that will return the details about our HTTP request.

How can a J2ME client send HTTP requests to a Web server or similar HTTP-enabled network server?

Using the Java 2 Micro Edition networking classes found in the javax.microedition.io package.


  • Wireless Network Programming with J2ME
  • Sending an HTTP GET Request
  • Sending an HTTP POST Request

  • Thanks for your registration, follow us on our social networks to keep up-to-date