How to send data from Android with 3G/UMTS to a PC - android

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.

Related

Unable to connect android socket connection over Cellular network

I am working on Android chat project. I have managed to build chat application which can handle text, file exchange and audio call using TCP Socket and UDP Datagramsocket connection. Every thing is working fine on local network but when I try to use cellular data it fails.
I am not much more familiar with the networking background but if it work on my local network then it should work on cellular network as it is a part of big network with some securities. I need help to figure out where I am doing mistake and how can i manage to resolve them.
In my project I am using port 80,1234,50002,50001,50003,8555,8553,8080 to communicate between client and server on TCP and UDP. On my local network I have no security so all ports are open for me locally but on cellular network may be these ports are not open. For this issue, how can I find the open ports on cellular network? Or is there any other alternative to use socket connection over cellular network.
Thank you

React Native: How to always route socket packets through WiFi even if it does not have an internet connection?

I have a React Native application that uses TCP and UDP sockets by bridging to Java and Objective-C code. Unfortunately, I'm not at liberty to share the code.
The problem is that when I attempt to use these TCP/UDP modules when my phone is on a WiFi network that does not have an internet connection they do not work because the packets are being routed through mobile data. If I use my code when on a WiFi that does have an internet connection or when my mobile data is switched off, it works perfectly. This is true for both platforms Android/iOS.
How can I force all packets to go through the WiFi connection even if it does not have an internet connection?
Thanks.

Communicate to a device using gprs tcp/ip

I want to send a command to a device using an android application which supports gprs tcp/ip communication. I don't know how to establish connection between device and android application.
You need to know IP address or DNS name of the device and TCP port.
Then you can just open socket and read/write there.
However you need to ensure your device has Internet access and accessible from the Internet.

UDP between 3G connected device and WiFi PC

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.

How to send the data from android(Client) to PC(WampServer) without an internet connection?

Am running a wamp server on my PC and i connected it to my android 2.2 device through WiFi.
In my app there is a listview of options to be selected, if i select some options, the Server should display those options which are only selected.There will be no internet connection. How can I implement this?
If the android device and the PC are on the same wifi network or internally routable to each other by a LAN including that wifi, you can use ordinary TCP client/server methods to communicate between them.

Categories

Resources