I'm trying to receive UDP packets from a wifi router in my android phone the phone connected to wifi router wirelessly. should I write a client in android to simply receive that UDP packet from specific port? how can I make sure that the data is received ?
Related
1.[os=linux]
Having a non android/ios device there is no standard push service available.
2.[no-public-ip/incoming ports blocked]
Connecting the Device to internet via UMTS stick and having no public ip and having all usable ports blocked by APN, no SSH connection will work..
3.
[low energy constraints]
Running on battery no polling shall be implemented.
Question: How to implement own push service (on virtual server/azure/aws) or how to to use android/ios push service on linux?
I want to send/receive data (e.g. binary or strings) from my mobile Android device to a PC over a WiFi Router.
Is it the same way I send data over WiFi with a TCP socket connection?
So I send data out of my client (Android device) and listen at my server at the port I defined?
If I already programmed the WiFi TCP socket connection, do I have to add additional program code to send the data with 3G or UMTS if I disable WiFi?
Thanks!
Michael
So it seems that there is no additional code necessary because the sockets are on a higher layer on the OSI-model than Wifi or 3G.
Is it possible to use UDP over the 3G network? I have tried but failed, I have an application on my PC that reads UDP packets and I'm trying to send UDP packets to that "server" using my 3G connected phone.
These scenarios works:
Local to Local over Wifi
External to External over Wifi
This does not work:
3G to PC
I found the following source. The most important thing for me is:
an iPhone can send UDP packets to hosts off the AT&T network
an iPhone can't receive UDP packets sent to it from a host off the AT&T NAT network
an iPhone SHOULD be able to send & receive UDP packets to other iPhones on the AT&T network.
We should be able to send DIS from an iPhone to a server
We should be able to do multicast on a WiFi interface, and send & receive to other
hosts on the same WiFi network
This should also apply to all other smartphones. If you can not receive UDP packages from your phone the packets could be blocked by your Network Provider, or something in your setup is wrong.
The bigger problems seems to me that you are unable to send data back to your phone. That makes all UDP calls a one way route and maybe render your server useless.
In order to scan a WiFi network for other devices, I send a broadcast with my application a a specific port to all IPs in the WiFi network.
Therefore the application, if it's running on a device in the WiFi network, has to respond to this broadcast.
At first I send a DatagramPacket with some data in it. Then the listening device has to listen on a port for this DatagramPacket and send it back with its own device IP.
How do I manage this?
i'm trying to write an app to discover hosts in the network ( like Network Discovery by Aubort), I have a question:
When the android phone send broadcast ping:
-Do the broadcast pings come to wireless router ( or Access point!) and it broadcast them for the phone? And then the wireless router receive and response the ping-echo-reply to the phone?
-If not the phone have to broadcast pings itself and I think not sure that it's signal quality is as good as wireless router's. So how to make sure that the phone have a complete scan in the network?!
(sorry for my poor English >.<)
Broadcast packets are retransmitted by the access point to other wireless clients (as well as to the wired network).