File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Push Registry with socket or datagram connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Push Registry with socket or datagram connections" Watch "Push Registry with socket or datagram connections" New topic
Author

Push Registry with socket or datagram connections

kubilay akgul
Greenhorn

Joined: Nov 16, 2002
Posts: 4
Hi,
I need my server(servlet) connect to a client(MIDP device) and let it know that the information that the midlet requested is ready. Then midlet will connect to the server via http/https to get the information.
It seems that this is possible with push registry. But I do not know which devices support "Push registry" with socket or datagram connections. Nokia 60 series seems to support SMS and bluetooth. Is that right?
Am I have to use SMS to implement Push registry on a real device?
PS: I can get the IP address and MSISDN of the client. So it will not be a problem for server to call the client back...
Ryan Chai
Greenhorn

Joined: Aug 26, 2004
Posts: 6
so far it seems like everyone is using sms to awaken a midlet.(maybe the only way?)

i think 6600 and 6220 are waht u r looking for.

i wanted to do the same thing as you. i have a midlet in emulator listening to port xxx. then i opened up telnet and just 'open' port xxx(doing nothing else) and true enough the midlet is awaken cause it detected activity on port xxx. i guess it is possible to awaken a midlet even without sms.

i could not prove this cause i do not own a midp2.0 phone. if i use the getLocalHost() on the emulator it will just return the pc's ip.

anyway u could try this:
download ur jar and jad file via OTA. since u say u could get the device ip, when u register ur connection, the server side app can get it automatically(if not just send it there). next, when the server have new information, the server app just need to include the device's ip when it open port xxx, then the midlet detect activity on that port and awaken.

at least in my opinion it can works this way.
so, pls let me know ur progress.
can u tell me how u get the ip and number of the device.(getLocalHost())??

thanks!!!
ps: hope u are able to prove this. in dire need for a sms-less solution

[ August 26, 2004: Message edited by: scud ]
[ August 26, 2004: Message edited by: scud ]
kubilay akgul
Greenhorn

Joined: Nov 16, 2002
Posts: 4
Hi,

It is possible to make a socket connection to a MIDP2.0 device with Push functionality. I have tried it on a Nokia 6600 and it works. The only problem you may have at this connection is some Operators do not allow inbound network connections towards mobile devices of GPRS network in their firewall.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
scud,

Please change you display name according to the JavaRanch naming policy, which you had agreed to when you signed up.

Thanks
Michael


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Ryan Chai
Greenhorn

Joined: Aug 26, 2004
Posts: 6
sorry bout the name.

yes, some operator do not allow inbound connection through their firewall. in that case nothing can be done, is it?. i've also read that some telco have all their devices under 1 gateway and under that the devices are given different identifier not in terms of IP addresses.
i guessed the only sensible way is to do it the SMS way.
may i know how u get the phone's ip and MSISDN???

thank in advance
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Chai,

Your display name still does not conform to JavaRanch's naming policy, which requires a first name and a last name. Please make the change.

Thanks
Michael
Ryan Chai
Greenhorn

Joined: Aug 26, 2004
Posts: 6
Michael,
in push registry, when we download the midlet via OTA, we will also publish our ip address to the server side app. of course we can't guarantee that our connection is always ON and using the same ip. let's say our connection is lost and a new ip is assigned to our device, will the AMS detect this change and automatically publish this new ip to the server app OR we can write a code segnment to do that??

since according to SUN, we are able do push through Http,datagram and socket and by publishing our ip, the server app can send 'alert' to the device, of course they had thought of this right?

Thanks in advance
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by Ryan Chai:

in push registry, when we download the midlet via OTA, we will also publish our ip address to the server side app. of course we can't guarantee that our connection is always ON and using the same ip. let's say our connection is lost and a new ip is assigned to our device, will the AMS detect this change and automatically publish this new ip to the server app OR we can write a code segnment to do that??



When you download the MIDlet OTA, the server normally gets the WAP gateway's IP address -- not your device's. Actually, in some networks, the device itself does not even have an IP address or only has an private address behind the firewall that blocks all incoming connections.

If the wireless operator wants to inform the server about your IP address, it could append a special HTTP header in each HTTP request from your device, which contains the IP address of the device. If this is the case, you can use a servlet to parse the IP address out of that header and bounce the result back to your MIDlet upon request. But again, this is highly operator dependent.



since according to SUN, we are able do push through Http,datagram and socket and by publishing our ip, the server app can send 'alert' to the device, of course they had thought of this right?


The J2ME spec targets generic scenarios. It leaves open the possibility that you might push using IP address but in reality, no wireless operator would allow you to do it easily. But this may change soon. With the new generation Wifi phones coming out, you might be able to get around the carrier network and give your phone a real IP address. But today, the easiest way to push is to use SMS messages.
firstName SecondName
Greenhorn

Joined: Mar 20, 2009
Posts: 15
kubilay akgul wrote:Hi,

It is possible to make a socket connection to a MIDP2.0 device with Push functionality. I have tried it on a Nokia 6600 and it works. The only problem you may have at this connection is some Operators do not allow inbound network connections towards mobile devices of GPRS network in their firewall.


hi ,
i want to launch my midlet using socket connection.
Can you tell me how can i do that?
I am just confused i.e
How you can access an application on a mobile device if you don't know the ip address of that device.
Becuase you know ip address is changing oftenly.
thanks and regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Push Registry with socket or datagram connections