I'm building an app to send a multicast message from all the devices to 224.0.0.1 so that every 1 in the network can receive it. But once i set up a tethering network and let all the devices join the network and do the multicast only the hosting device does not receive the multicast and other devices does not receive tethering hosting device multicast. How can i make the tethering device also receive multicast data packets?
Related
I created a sample app, with just 3 buttons, Connect , send msg, disconnect.
I am using TCP server on another mobile B, (any available tcp server app or test tool app).
and our client app is on mobile A.
Case 1. Both the Mobile A & B, are on same wifi network, app is working fine (connect, disconnect) if both have same internet or does not have any internet over wifi, and client device does not have internet availability on other network, like 4g.
Working
Case 2. Both the Mobile are on same wifi network, but in client app device, Mobile A has 4g connection with internet available, now the app is not connecting with tcp server over wifi network.
this wifi network does not have internet connectivity.
Not Working
so case 2 is not working. If devices are on same wifi, and client has other 3g/4g working internet , the app is not connecting over wifi.
I need to implement a messaging system for Android phones.
The server has static IP, it runs JAVA and it should send periodically UDP ping messages to android phones.
As I understand mobile phones have NAT IP.
The question is how server can send message to this IP.
Can I create socket between two devices where one device is connected to wifi internet and other is connected to 3G or 2G internet. Or both devices are connected to 3G or 2G.
WHY do you do that?
you can create a socketServer at PC side.
And all android apps can create socket to connect the SocketServer.
whatever you use wifi or 2G,3G.
Yes you can create socket,
Socket creation takes two paramter a valid IP address and a port Number to establish connection.
i.e socket= new socket(IPAddress,Port) it depends upon just a route to resolve the IPAddress where port should be available to listen.
I want to
Recieve UDP message on device when it is connected through wi-fi
Know how to send udp message on device when it is connected to wi-fi
router as the sender on diffrent network
What i have tried
http://code.google.com/p/boxeeremote/wiki/AndroidUDP
What is working
UDP messeges are being recieved on device when it is connected
through 2g/3g data service
UDP messeges are being recieved when sender and reciever are both in
same network ( behind wi-fi router )
Any help/point in right direction is appreciated.
When the device is behind a wi-fi router, it has a private address so it isn't reachable from outside the private network, at least no without some extra work.
You need to do Hole Punching, is what applications like Skype do to receive UDP packets. Applications usually use a STUN server in order to achieve this.
The easiest alternative would be to have a server with a public address and make all the devices connect to the server with tcp/ip protocol. If you can't afford that you need to do Hole Punching.
Referred to this link and i have done sample Client/Server Apps using android.The apps work well on GSM sim's able to send and receive packets,but on CDMA device i am not able to receive any packets but able to send packets.
Ip address details is drawn from this app
Whats going on here?