• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About wifi networking between mobiles

 
Mostafa Ahmad
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone

I am new in the field of j2me, I want to ask about the possibility of making a program that makes 2 mobiles exchange data through wifi. Is that possible using j2me?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Mostafa.

Wifi networking between mobiles is a lot like wifi networking between desktop machines. As long as there are no firewall restrictions within the mobile devices that interfere, the only other issue is that the 2 devices need to have a usable route between them.

As long as both devices are talking to the same Access Point they'll be on the same subnet and that's generally fine. If they are on different access points, it can be a problem, since each access point will typically assign non-unique, non-public IP addresses to its clients. And if the transmissions should end up routed through the phone service provider (carrier), you'll almost certainly end up dealing with non-unique, non-public IP addresses, since the telco radio NIC is virtually guaranteed to be getting its network address assigned via DHCP.

I mentioned the last issue because in TCP/IP, you can have multiple NICs in a single device - I have one that has a telco NIC, a WiFi NIC, a Bluetooth NIC, a USB cable NIC and an infraRed NIC. According to TCP/IP, I cannot directly request a specific NIC. In fact, transmissions may use multiple NICs. Actual selection of the NICs being used are made by the network control services based on the routing tables in effect on the system.
 
Mostafa Ahmad
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for fast reply

But I ask about another issue. I want to make a connection between 2 mobiles without access point. The same case as making local network-without router-between 2 pcs, by just connecting them with a cable. I imagine that the only difference regarding 2 mobiles, will be the medium of communication.Is this ok or there are other factors that I am not aware with?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not how WiFi works - one of the devices would need to create an access point. The newer Android versions can do that, but I'm not sure about JME.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mostafa Ahmad wrote:Thanks for fast reply

But I ask about another issue. I want to make a connection between 2 mobiles without access point. The same case as making local network-without router-between 2 pcs, by just connecting them with a cable. I imagine that the only difference regarding 2 mobiles, will be the medium of communication.Is this ok or there are other factors that I am not aware with?


You can't directly interconnect 2 PCs, either. You have to use a special (crossover) cable.

Technically, the function of connecting multiple clients on a single LAN segment (wired OR wireless) is the job of a switch or hub. However, most wireless access points have both router and switch incorporated as part of the same unit.
 
Mostafa Ahmad
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it is not possible to get a direct connection between mobiles. I thought that it is possible. I thought that I can manage the matter with wifi the same way as I can with bluetooth. As I know connection of 2 mobiles using a bluetooth does not need an access point, but bluetooth does not have a good range (10m max I think ?). Is not around any method that enables me from connecting 2 mobiles wirelessly and in the same time has a good range like wifi ?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bluetooth is a direct peer-to-peer protocol. TCP/IP isn't that dynamic.

I don't know of any other options commonly available. Obviously, the telephone network itself has range, but, as in the case of WiFi, you'd need an intermediary server to link the two.

There is an extended-range version of Bluetooth, although the actual practical range will vary depending on the quality of the hardware and the radio-friendliness of the theatre of operations. I think the standard Bluetooth limit is 30 meters, although I get only about half that inside my house because of intervening walls and structures.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic