Meaningless Drivel is fun!*
The moose likes Java Micro Edition and the fly likes About wifi networking between mobiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "About wifi networking between mobiles" Watch "About wifi networking between mobiles" New topic
Author

About wifi networking between mobiles

Mostafa Ahmad
Greenhorn

Joined: Feb 22, 2011
Posts: 11
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

Joined: Jun 25, 2001
Posts: 15958
    
  19

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.


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

Joined: Feb 22, 2011
Posts: 11
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
Marshal

Joined: Mar 22, 2005
Posts: 41116
    
  45
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.


Ping & DNS - my free Android networking tools app
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

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

Joined: Feb 22, 2011
Posts: 11
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

Joined: Jun 25, 2001
Posts: 15958
    
  19

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.
 
Consider Paul's rocket mass heater.
 
subject: About wifi networking between mobiles
 
Similar Threads
How to decrease JAR file size ?
another great article by Michael Yuan
REST in mobiles
sms to GSM and CDMA mobiles through web
J2ME compatible phone list