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 making a midlet on phone to access a servlet on pc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "making a midlet on phone to access a servlet on pc" Watch "making a midlet on phone to access a servlet on pc" New topic
Author

making a midlet on phone to access a servlet on pc

Kenneth Owino
Greenhorn

Joined: Aug 09, 2010
Posts: 23
hi there. i made my midlet that connects to a servlet via http and it works when i try it out with a an emulator but when i uploaded the midlet to the phone the commands to access the servlet couldn't work. what do i need to do to test my application with midlet on phone and servlet on pc?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

You need to make sure that your phone has tcp/ip networking capabilities enabled and you need to have a path from it to the server. If you're using the phone company tcp/ip network, that means that there must be a public Internet address at which the servlet can be accessed. If you're using WiFi from the phone, it means that there must be a path through the WiFi access point to the server containing the servlet.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kenneth Owino
Greenhorn

Joined: Aug 09, 2010
Posts: 23
sorry for taking long to respond. my main problem is how to create a path from the phone to the server which is on my pc. i uploaded my midlet to the phone but it could not access the servlet. it seems to me that there is not network between the phone and the pc althoug there is a mode of connection which is bluetooth. what should i do to create such a network and enable my midlet access the servlet? the servlet is running on the pc in localhost? thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

Network access on a mobile device depends on the device and on the JVM. TCP/IP networking allows you to have multiple NICs in your configuration and the network stack itself is responsible for picking the one that gets the traffic through.

Depending on the device and JVM, tcp/ip networking can be done via zero or more of the following interfaces:

1. The telephone network
2. WiFi
3. Bluetooth
4. USB or other data cable
5. Infrared port
6. Anything else someone might come up with that can be wired into a network!

Use of the telephone network usually requires payment of an extra data charge and activation of the data facilities on one's phone account. Some Bluetooth stacks aren't complete enough to support TCP/IP, and limit themselves to non-network uses such as wireless headsets. WiFi has the limitations that not all devices support it and it may need to be adjusted to different connection points as you move from place to place. Plus WiFi range is limited (but it's usually very fast!). Also, since WiFi consumes extra power, you may need to switch it on before you can use it.
Kenneth Owino
Greenhorn

Joined: Aug 09, 2010
Posts: 23
I used bluetooth and successfully installed the midlet to the phone however the midlet can only display the midlet part of the program but is inactive when the command to access the servlet is selected. could there be any additional configuration needed for this bluetooth connection. please give some information on what is done to make the midlet access the servlet using bluetooth between the phone and the pc. thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

In order to do that, your Bluetooth stack has to support TCP/IP networking, and TCP/IP over Bluetooth has to be switch on and configured.

The details on how to do that will vary depending on the device you're using. It's done using the device OS control functions, not in Java. And not all devices can do it.
Kenneth Owino
Greenhorn

Joined: Aug 09, 2010
Posts: 23
Thank you very much for guiding me through. Am going to try out the configurations and will get back to you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making a midlet on phone to access a servlet on pc