• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how do i create connection for a cell phone

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic