Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

making a midlet on phone to access a servlet on pc

 
Kenneth Owino
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kenneth Owino
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for guiding me through. Am going to try out the configurations and will get back to you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic