-1

i've created a UDP server in c# that listen to specific port for UDP data, the project relie on Dataloggers to send data via GPRS, but because we do not have these dataloggers yet, and for testing purposes, is there any way or idea to make my android phone that has a SIM card send data to the server static ip adress with specific port through gprs network ? pls help

i've seen some videos of sending gprs data using gprs module like sim900 and arduinos, but i have only a smartphone right now

1 Answers1

0

GPRS is simply your communication layer. You wouldn't care if a PC is connected to your hard-wired network or wifi, only that it is able to communicate with the IP and port. If your UDP server is available any client that knows its IP and port, (and isn't blocked by firewalls, or network topology) should be able to communicate with it. While doing so from Android may have benefits, a simple console app would test your server the same way.

https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient.send?view=net-6.0

UdpClient udpClient = new UdpClient();

Byte[] sendBytes = Encoding.ASCII.GetBytes("Is anybody there");
try{
    udpClient.Send(sendBytes, sendBytes.Length, "www.contoso.com", 11000);
}
catch ( Exception e ){
    Console.WriteLine(e.ToString());    
}
Anthony G.
  • 452
  • 2
  • 7
  • but what i want is simulating gprs data send even via SMS to the server so he can get this msg, slipt it, and get the useful data from it! sorry i'am knew in all communication app and layer – LYOUSFI Marouane Oct 27 '22 at 10:18
  • SMS is a different thing entirely. Receiving a message sent over cell network will require you to have a cell enabled device or use an API like Twilio. https://www.twilio.com/ If you could post more details about your project it may clear up misunderstanding. – Anthony G. Oct 27 '22 at 14:26
  • Well the project is creating a winforms application for receiving data sended by dataloggers and displaying it or saving it in mysql database. The dataloggers use UDP over GPRS communication to send data to the server where the app is installed, i'll need also in the futur to receive sms sended by those dataloggers in the server – LYOUSFI Marouane Oct 27 '22 at 19:46