Skip to main content

Connecting to a local server

5 replies [Last post]
emesol0
Offline
Joined: 2007-08-23

Thx alot Terrace

Now I understand the concept...it is the same as the HttpConnection in J2SE...but I've a little difference here; the cell phone I've now has no Internet connectivity...but I've a local J2EE web application running on Apache tomcat...will I be able to connect to it through my mobile phone through a USB cable connection and by changing the URL connection to http://localhost:8080/MyApp ? will the same concept work or do I need to do something else?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04

Most new PCs have BT built in. If not, you can buy a cheap USB BT device (dongle).

-- Terrence

terrencebarr
Offline
Joined: 2004-03-04

Oh, one more thing: If your phone has Bluetooth you can establish a connection to the desktop via Bluetooth ... not sure if you can pipe HTTP that way, though.

-- Terrence

emesol0
Offline
Joined: 2007-08-23

Yes I have bluetooth but I think I will need an additional device in my pc? like a wirless LAN card or something?

terrencebarr
Offline
Joined: 2004-03-04

Hi again,

When you say the phone has no Internet connection: Is that because it has no data service enabled on the operator plan or because you don't want to use the wireless connection?

I assume you want the second option. This is tricky because the phone must now redirect HTTP to go over USB instead of wireless ... this *may* be a developer option on some phones but you would have to check the specific model. It will also need support on the PC/desktop side.

You should check the protocol support for the Generic Connection Framework package (javax.microedition.io) for the particular phone you are interested in. The device manufacturer may have included support for your case. Also check the development environment ... for example, I know that SonyEricsson's SDK has a connection manager for the desktop that can establish certain types of connectivity via USB to the phone.

Let me know how it goes. I'd be curious to know myself.

-- Terrence

emesol0
Offline
Joined: 2007-08-23

Your assumption was right. I want to use the second option, since I do not have an internet account right now (my Sony Ericsson supports wireless Internet but I'm not registered for the service at the moment). The thing is I still cannot access the Internet via the USB cable, but I think this is a device-technical issue.

But now I got the concept of HttpConnection working right on my J2ME device emulator and it successfully communicated with a servlet via the GET and POST requests...

thx:)