Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do i create connection for a cell phone

 
Madhup narain bhardwaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi mates!!
i have been developing an application for a cell phone,which requires me to constantly interact with a backend server and a cellphone, earlier on i was using a connection object like
sc = (StreamConnection)Connector.open("socket://XXX.XXX.XXX.XXX:9999");
which seemed to be working fine on emulators.
My problem started when i ported the application over a cell phone.
The connection seemed not to work.Is there any way that i can get data flowing like it was in the emulators??
I havent used servlets, and modifying my code for servlets will require rewritting the entire application again.
Help me out will ya!!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your phone support socket connections? (if it isn't a MIDP 2.0 phone, it probably doesn't)
 
Madhup narain bhardwaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well
if i have to develope an application i guess so that i must do it so that it would support all the phones.
How do i actually go about doing so, also assuming that my phone does not support MIDP 2.0
all replies will be appreciated
thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that only MIDP 2.0 phones are required to support socket connections ("socket://") -- MIDP 1.0 phones can optionally support socket connections but 99,99% of them don't.
If you want to support all MIDP phones, you'll have to resort to HTTP connections instead of raw sockets.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"I havent used servlets, and modifying my code for servlets will require rewritting the entire application again.
Help me out will ya!!"

No, one servlet is enough!
 
serge masse
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that the MIDP 2 spec does not require that the device supports socket connections. The spec only recommends that the device supports them. Therefore, in mid-2004, most MIDP2-compliant phones do not support sockets and furthermore, even if you purchase a device that has a version of a MIDP2 runtime that supports sockets (such as the Treo 600 with your installation of IBM MIDP2 JVM), it is likely that the carrier does not support TCP sockets, as most don't today.

We must raise flags in order to change the situation. Lets do it at JavaOne at the end of June.

See you at JavaOne
serge masse - BOF-1019 - Wednesday June 30, 7:30 PM
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic