J2ME vs WAP ?

Hi,
I am starting on wireless, but I have a question about the difference to develop a WAP application (WEB server + JSP + WML) that the user can access from their device (PDA, Cell phone) in order to access some resources vs. develop an application with J2ME(MIDP)?
The J2ME app, is loaded into the device?
How the resources is access (eg. database,etc), from a WAP app we could create a servlet in order to query a database, in J2ME/MIDP is possible to get access also?
Thanks in advance!

Hi,
Yes, you can to use the servlet also to develop your J2ME application but it is some difference vs WAP application. You can to implement the doPost method in the Servlet class and also can to read the string command send for the J2ME client. For example you can to use:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer messagebuffer=new StringBuffer("");
byte ch;
char c;
ServletInputStream in = request.getInputStream();
DataInputStream din = new DataInputStream(in );
while ((ch =din.readByte()) != -1){
messagebuffer.append((char) ch);
c=(char) ch;
if(c=='$') break;
String req=messagebuffer.toString();
//req is the command from client
//your code
//send the response to J2ME client
response.setStatus( response.SC_OK );
ServletOutputStream servletout = response.getOutputStream();
DataOutputStream ot=new DataOutputStream(servletout);
ot.writeBytes(res);
ot.flush();
ot.close();
servletout.close();
From client you need to make the connection to this Servlet and also need to send the request for this Servlet(follow by $). Out, this can work like the WAP application, but you have also more options. In the Servlet you can to connect to the database, or to the other device to form the J2ME client response.
hope you help
Sorry for my bad english
Calin

Similar Messages

  • J2ME and WAP

    hello,
    plz.. help me in this problems???
    is J2ME uses WAP to transfer information???
    is j2me progrmas uses WAP Gateway in between wireless device and webserver??????
    waiitng fr responces.
    Niranjan

    The classes in J2ME that are used to connect to the web, are not classes but interfaces. This leaves the vendor to develop it's own implementation for these interfaces, and should abstract the particulars (does it use WAP, or TCP, or anything else) of how the connection is made.
    So, to answer your question, how the connection is made depends on which phone you run the application on, and it also depends on how the phone is configured.

  • Server Push   pushing data to clients

    Need some ideas.
    I have been hunting around for info on a simple/clean method
    to push data out to clients. Client could be a Java application or maybe an applet. Solution must easily go through firewalls
    In either case I want the client to startup, register with the server
    and start receiving data. Without further user intervention.
    Whatever, scheme is used must be able to deal with network
    disconnects.
    I have looked at Pushlets, the article was 2 years old and I don't see
    any recent postings on Pushlets. So maybe that is not the way to go.
    I guess my other choice is JMS. SonicMQ?
    Server Push using Netscape?
    Or are there other options.
    Many thanks for your feedback.
    KD

    Have you considered J2ME.
    J2ME and WAP Push can be complementary. but for WAP Push to work the devices or the browsers in the devices have to be WAP 1.2 complaint.
    more details can be found at http://devforum.openwave.com
    hope this helps.
    williams

  • How j2me relates to WAP gateway?

    Hello to everyone,
    I want to know that,
    Without using a wap gateway how j2me works?
    According to me, Gateway is used to connect two different networks
    Lets say I am calling a jsp page from MIDlet.
    mobile devices belong to wireless network(j2me),
    jsp(j2ee) is on internet.
    How do these communicate ?
    thank you in advance,
    vishnu mahendra

    Hi,
    If u got answer for this the let me know
    thanx in adv.
    Raj

  • WAP connection thru j2me application

    Hi,
    We are connecting Login Screen in J2ME to database using HTTP connection. It running successfully in emulators. But it can't connect to database in device. Is there any option to connect database except HTTP connection.....
    It is a WAP url...

    More info needed.
    How is it failing? Post error message.
    Is the server accessable from the web at large?
    Is the provider blocking, or otherwise messing with HTTP connections?

  • [Question] Can I call a wap browser from a j2me program?

    Hi, everybody, I am new to j2me programming. Now, I want to call a wap browser to visit a site from my j2me program.Can anybody tell me how to do it?

    Check this from MIDP2: Classes MIDlet
    platformRequest
    public final boolean platformRequest(String url)
    throws ConnectionNotFoundException

  • Downloading J2ME apps via WAP

    Hey, how to do it so that I can download J2ME applications via Wap? I know that i have to link to a JAD file, but it doesnt work. Does anyone know how to do this?

    At least in the Siemens devices, you have a specific configuration for Java, which is different from that of WAP and GPRS. You may navigate through WAP, but when a midlet is found, a different setup is automatically changed to accomplish the download.
    In the M50 handy, you have to set the Java profiles according to the parameters of your provider; in the c55 handy, the same set is called "HTTP profile" and it is used also for other kinds of download (e.g., http connections in the midlet).
    Enzo

  • Wap and j2me

    Hi,
    iam having a general doubt on wap vs j2me.i find in some places like (getrid of wap) or (say goodbye to wap) replacing it with j2me.But, how is data sent from a server to client and viceversa.(ie) what is the transport layer and the protocol thru which the data is sent!.
    Thanks,
    RP

    Hi,
    iam having a general doubt on wap vs j2me.i find in
    some places like (getrid of wap) or (say goodbye to
    wap) replacing it with j2me.But, how is data sent from
    a server to client and viceversa.(ie) what is the
    transport layer and the protocol thru which the data
    is sent!.
    Thanks,
    RPThe network/transport layer of j2me is implementation dependant. It can be TCP/IP or it can be other protocols like bluetooth ... etc...
    J2ME implementation must talk HTTP as an application level protocol. It generally is also able to make socket connections so user defined protocol may be used.
    However, I don't believe that WAP and WML should be got rid of. They do serve a great purpose.

  • Opening wap browser from j2me application

    is there any way to open a wap browser which already available on the handset?
    the scenarion maybe like this, there is a menu and each item on the menu when chosen will open a wap browser directed to a certain wap site.
    so if there's is an item for Yahoo! Mail, wheh user click it. the wap browser would open the yahoo mail site.
    TiA

    Hi,
    I'm trying a similar thing (open the default mobile browser with the command line platform request). I works, but I tried it on different emulators, and they don't react the same way. For exemple with the Nokia SDK series 40 (standalone and with WTK2) the midlet is first running and I have to exit the midlet before I am asked if I want to go to the url.
    What can be the reason ? Is it possible to force the browser to be openned and have the midlet running background ?

  • How to get a HttpConnection by a WAP access point over GPRS

    Generally,every phone's WAP browser can get to every wap site by a WAP access point,and every phone can get a connection by an internet access point in J2ME too.
    But in J2ME,If APN configuration is a WAP access point,Nokia3100/6100/3650 can be successful to get a connection generally,and SonyEricsson's phone don't work.
    I'm in Philippines and use Globe Telecom's SIM card.Globe's WAP APN is "www.globe.com.ph/ewap.globe.com.ph", and internet APN is "www.globe.com.ph".
    If APN configuration is a WAP access point(www.globe.com.ph),My phone(SonyEricsson's P910C) don't work.
    following code:
    HttpConnection conn = (HttpConnection) Connector.open(url, Connector.READ_WRITE, true);
    conn.setRequestProperty("Connection", "close");
    conn.setRequestMethod(HttpConnection.GET);
    conn.setRequestProperty("User-Agent","Profile/MIDP-2.0, Configuration/CLDC-1.0");
    InputStream is = new DataInputStream(c.openInputStream());
    How to do to be able to make every phone get a connection by a WAP access point(www.globe.com.ph) in Philippines.
    For example, In China, I can set proxy property to make every phone work by a WAP access point(CMWAP).
    following code:
    //"10.0.0.172" is China Mobile's WAP gateway proxy
    HttpConnection conn = (HttpConnection) Connector.open("http://10.0.0.172:80"+URI, Connector.READ_WRITE, true);
    conn.setRequestProperty("X-Online-Host", host);
    is = conn.openInputStream();
    Reference:
    http://www.reqwireless.com/apns.html
    http://forum.java.sun.com/thread.jspa?forumID=76&threadID=509365
    http://forum.java.sun.com/thread.jspa?forumID=76&threadID=538294

    i can load my jar file in my mobile through live IP.
    it works properly when simple text,list, or any features of the MIDP
    or j2me but when i call the servlet from midlet at that time
    "java.io.exception' is fired on the mobile ...
    so please help me for that.
    why it gives us an error like this .?
    we used live ip for the communication but it gives error like this.
    i also run the application on emulator it works properly through
    the live IP but when i access from jar file in the mobile it gives
    me error.
    plz help me.
    if u have any contact no then tell me . i can call u later on.
    my mobile no is 9879236686
    my mail address is [email protected]
    u can call me also any time.

  • J2ME WITH TOMCAT

    Hello Guyzz
    i want to create an j2me application where it connects to the webserver like tomcat . .
    i can do it in j2me wireless toolkit emulator but when i deployed that jar file in real device it was not working .
    i want to build this application using private ip address but not with public ip address no problem if we use
    datacable or bluetooth connection instead of GPRS . . .
    Let me know if any one have idea about this . .
    Thnx in advance

    Thanks for your reply but i am not sure that i understood ! Do you suggest to connect another mobile phone to my pc and use it like a wap gateway or something and then call it from my j2me phone the same way i call my wap provider?
    Why not connecting my phone directly to the pc?
    thank you very much!!
    Sorry if i am saying something completely wrong !!!

  • Real J2ME applications (2)

    I am looking for real j2me applications.
    I have already posted this question at:
    http://forum.java.sun.com/wireless/thread.jsp?forum=76&thread=422879
    However, most of the replies gave examples of games or tutorial examples.
    But I was looking for j2me applications implemented by companies for their consumers, such as amazon.com.
    Amazon have a mobile app, but its implemented in WAP.
    So are there any companies which have implemenetd j2me apps.
    regards

    You could find tonns of real j2me applications if you type the following keywords to any search engine: midlet download free/buy j2me.
    Here is a real game application: www.kisember.com/test/rescuedemo.jad

  • J2ME serversocket on Siemens S55?

    I try to establish a serversocket connection on a Siemens S55 device. My aim ist to realize a webserver application on the mobile phone. I want the S55 to act as a server, accepting client connections from other devices / pc's.
    The J2ME MIDlet works fine on the SMTK S55 emulator. But when I start the midlet I always get an IOException from the acceptAndOpen()- method.
    Here's the source code:
    String url = "serversocket://:" + port;
    try {
    notifier = (StreamConnectionNotifier) Connector.open(url);
    sConnection = notifier.acceptAndOpen();
    catch(IOException e) {
    display.appendText(e.toString() );
    Does anyone have any experience with this problem?

    I have the same problem on a SL45i phone. It seems it has to do with dial up connection.
    I read about this in a document called "SMTK_ProgRefM50.pdf", but it's still quite unclear to me. What I understand of it, is that you can't use a WAP provider for HTTP requests. You would need a 'normal' internet provider (like when you dial-up with an analog modem in a computer). The problem is that, although all settings seem to be correct, I can't connect to such a provider.

  • What is exactly is J2ME?

    From what i understand, WAP is a protocol that is established for the way in which wireless technology is used for Internet access and WAP pages are written in WML language.
    Mobile phone ----> WAP gateway ----> Web Server ----> Database
    (WML pages)
    So, is J2ME a protocol or what? Or is it just for creating midlets program and runs the same way as WML pages? If so, why are they saying J2ME will or might replace WAP.
    Can someone please explain this to me.
    Blaise,

    The Java 2 Platform, Micro Edition (J2ME) was developed specifically to address the vast consumer space of small devices, ranging from smart cards to pagers. This space, with its limited memory and display constraints, has proved to be an ideal environment for Java. It might make sense to state up front what it is not, and that is a replacement for WAP. Those who follow this space will quickly agree that, instead of looking at it as a WAP competitor, J2ME should be looked at as a complementary technology used to further expand the usefulness of wireless access and applications.As you mentioned, WAP is a browser technology that allows users to browse WAP-enabled Web sites. Unfortunately, although useful in what it does, it does have a few shortcomings, including security and the fact that it requires constant airtime for stand-alone or offline operations. When coupled with J2ME, however, users will now be provided with a full-featured Java-based application environment from which to enhance their experience. What makes it especially appealing is the fact that implementation is as easy as having your users download the application via their standard WAP browser.
    Furthermore, by employing this type of technology, users will no longer be restricted to the limited monochromatic interfaces seen on WAP devices today, but rather we will enjoy full-color, animated graphics and applications that are much easier to navigate. Once a Java application has been stored on a handset, it can then exchange data with backend information systems using the existing WAP infrastructure. With that said, users will also be happy to know that applications developed with J2ME are upwardly scalable to work with the Java Platform, 2 Standard Edition (J2SE) and the venerable Java 2 Platform, Enterprise Edition (J2EE) with little rework required.

  • What are the ways to download j2ME app to j2ME phones

    Hello Friends,
    What are the ways to download j2ME app to j2ME phones, is there any method that all phones supports.
    I am downloading app to different phone in different ways, i.e using infrared, bluethooth, cable (different cable for different phones), URL (WAP)... offff.....
    Can any one let me know is there any one way that we can download app to phone... i mean is WAP URL support on all phone?
    Thanks
    Kumar.M.R

    The following Java tip may help:
    How to install a J2ME aplication on a mobile device
    http://www.java-tips.org/content/view/617/73/

Maybe you are looking for