How to foce Nokia 7210 SDK to use HTTP rather than WAP?
0 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Sunday, September 28, 2003 05:02 AM

Hi there, In the Nokia 7210 Emulator, I click File -> New and i enter my ip address called:    More>>


In the Nokia 7210 Emulator, I click File -> New

and i enter my ip address called:

I can't get the phone to access it...

so I play with the Tools -> Settings

and under Wap Networking, the gateway ip is (i
try to set it to 0.0.0, but can't work)

and under the MIDlet Networking, i already check the
Enable HTTP communication checkbox.

To QC, i go to Tools -> Status Window

AND I notice that no matter what it still goes to WAP
Communication Requests 1 (the counter will increment)

The HTTP Communication, Request still 0. (i try to
connect to the internet, also http request is still 0)

Sad story, so i do some coding in servlest and midlets

Well i learn from the java sun website...

Below is the source code:



import java.io.*;

import javax.microedition.io.*;

import javax.microedition.lcdui.*;

import javax.microedition.midlet.*;


* An example MIDlet to invoke a CGI script.


public class FirstMidletServlet extends MIDlet {

private Display display;

String url =


public FirstMidletServlet() {

display = Display.getDisplay(this);


//Initialization. Invoked when MIDlet activates

public void startApp() {

try {


} catch (IOException e) {

System.out.println("IOException " + e);




//Pause, discontinue ....

public void pauseApp() { }

//Destroy must cleanup everything.

public void destroyApp(boolean unconditional) { }

//Prepare connection and streams then invoke servlet.

void invokeServlet(String url) throws IOException {

HttpConnection c = null;

InputStream is = null;

StringBuffer b = new StringBuffer();

TextBox t = null;

//Form t = null;

try {

c = (HttpConnection)Connector.open(url);



"20 Jan 2001 16:19:14 GMT");


"Profile/MIDP-1.0 Configuration/CLDC-1.0");

c.setRequestProperty("Content-Language", "en-CA");

is = c.openDataInputStream();

int ch;

// receive response and display it in a textbox.

while ((ch = is.read()) != -1) {

b.append((char) ch);


t = new TextBox("First Servlet",

b.toString(), 1024, 0);

// t = new Form(b.toString());

} finally {

if(is!= null) {



if(c != null) {









import java.io.*;

import java.util.*;

import javax.servlet.*;

import javax.servlet.http.*;


* The simplest possible servlet.


public class HelloServlet extends HttpServlet {

public void doGet(HttpServletRequest request,

HttpServletResponse response)

throws IOException, ServletException {


PrintWriter out = response.getWriter();

out.println("Servlet invoked!");

out.println(new Date());



And it works fine. I can see now it goes directly to
Http rather than Wap anymore.

*Note: The servlets and compilation of the java works

Any idea. How to make the emulator possible to
"force-to-point" at HTTP rather than WAP.



Chua Wen Ching :p

About | Sitemap | Contact