×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    54

    How to know data is coming from the server

    Hi every one!
    I want to know one thing and I cannot find the suitable information. I want to know is in my application I send the data to the server and at the server check there has the new data or not for that phone. If the new data has for that phone, send the data to that phone. I use the servlet to send the data back to the phone. I really want is when the phone receive the new data from the server, I want show alert as new sms alert. In phone,if we receive the new sms, the phone show the alert and trigger the sms tone. I want to trigger the alert when I get the receiving data from the server

    Please give me some instruction!

    Thanks you
    With regards
    Sweet Sweet 24

  2. #2
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: How to know data is coming from the server

    Hi Sweet Sweet 24 ,
    1. You can check the content length of connect . i.e con.getLength() method . If you have any data in input stream it will give you the length of the data. But in some phones it will not work.

    2. One more way in both the cases if data is there in the server you have to pass data is not there kind of a string from server to string . If data is there you have to send the data to the client.
    if you get the nodata String you have to ignore the respose else show the alert with the repose data.

    3. The efficient way is when you are doing this data transfer you have to send the data in a structured format like XML . If you use XML's define the tags and send the data to the client

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    54

    Re: How to know data is coming from the server

    Thanks you Bhanu for your quick reply!
    I can learn new things from you. Now I can send and receive data by the easiest way. I really want is when I receive the new data from the server, I want alert the user about the new data is arrived.

    My program will run in background and at every minute, the midlet will send the phone number and at the server, servlet will retrieve the data from the database according to the phone number.

    If there has the new data for that phone number, the servlet will send back the data to my midlet.
    At there, when my midlet (it will be running in background) receive the data from the server in background, I need to inform to user about the new data arrived.

    How can I inform to the user the data is arrived?

    let say at the sms ,sms program will run in background and when the new sms is arrived , the phone will notify to user there has the new sms. I want to do like. I want to inform the user when the new data is arrived from the server.

    Any way, very thank you for your reply and please give me instruction for alert the user when the data is arrived from the server.

    Thanks you
    with regards
    Sweet Sweet24

  4. #4
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: How to know data is coming from the server

    Hi Sweet Sweet 24 ,
    You can do like
    If the data is there for that number say at server.
    <res>
    <data>Yes</data>
    <message>You have new data availble</message>
    </res>

    Or
    You will request for the server If the data is there server will write the data in output stream What ever the data availbale to that phone number

    in client using inputstream you have to get that data and show the alert.

    If the data is not there
    <res>
    <data>No</data>
    </res>

    Or
    If the data is not there for that number
    Client and server need to be synchronize with one String if the data is not available I will send "NODATA" to you if you get the response as NODATA ignore my response. And also assume no data available for that is number

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    54

    Re: How to know data is coming from the server

    Hi Bhanu!
    Thanks you for your replying.
    I think we have a misunderstood. I want to do is like the sms push registry. If I register for sms at specific port, when the message is coming to that specific port, the application will launch automatically. Like that, when I get new data from the server, I need to automatically launch my application(my midlet).

    How can I launch my application when I receive from the server?

    I use only httpconnection, not use socket connection.

    Please give me some instruction how can I launch my midlet when the data is came from server.

    Thanks you
    With regards
    Sweet Sweet 24

  6. #6
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: How to know data is coming from the server

    Hi,
    I thing you have to work with server socket . You have to listen on some port . if the data is available server has to invoke the client. I to don't have a clarity on that plz go through the server socket documentation you can get some thing for your reference
    http://developers.sun.com/mobility/m.../midp2network/

Similar Threads

  1. how to store data in mobile from the server using midlet
    By vinoy_george99 in forum Mobile Java General
    Replies: 9
    Last Post: 2009-05-28, 05:40
  2. How to handle UI, server connection and file handling in MIDP application for 6630?
    By SanjayKhuntia in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-09-19, 08:36
  3. How to send mobile file data to Server on Nokia 6630?
    By SanjayKhuntia in forum Symbian
    Replies: 1
    Last Post: 2008-08-25, 11:26
  4. GPRS connection problems on 6600..
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2005-12-02, 14:00
  5. how i can send data from server to MIDlet through GPRS?
    By vinayakchitre in forum Mobile Java General
    Replies: 0
    Last Post: 2004-07-16, 10:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×