This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic Technical Network Question  RSS feed

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I working with and testing diffrent kinds of way to get information from a server to my midlet. Im using WTK and when my midlets want to reach the server it uses my Workstations connection. But how dose it work if the midlet was executed on a real cellphone. Which techniques are aviable for cellphoneuser to get info from a server using a wireless-techniques?
 
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MIDP 1.0 phones provide HTTP networking, MIDP 2.0 adds HTTPS, socket (TCP), UDP, and serial port connections. Then there's Bluetooth and IrDA.
(others, please correct me if I remembered something wrong)
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The syntax is something like:

Then you can link the appropriate data streams, etc to read and write from the connection.
note: HttpsConnection (and other connect types) are only supported under midp 2.0, use HttpConnection if you are developing to a midp 1.0 phone, and don't forget the java.microedition.io.*; and the java.io.*; (for IOException, so you can catch the correct exception if there's a problem) packages.
Jason
[ March 24, 2004: Message edited by: Jason Fox ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!