Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I searched everywhere but nothing was what I needed.
You can look at it as a chat client between an android app and a windows form, I just need something on an apk to send a certain string to the windows application wich do something with it.

NOTE: I would like to be able to do it with portforwarding or just both devices on same wifi network, not trough bluetooth or USB.

What I have tried:

Tried other person's projects, searched google, youtube, github, ... but I found nothing that does this.
Posted
Updated 11-Aug-18 7:54am

1 solution

Typically, you'd have something like a web service on the receiving end of things. If you definitely want to use a WinForm app, you probably want to use a TCP client and server. If you're new to programming, this will not be trivial, especially when communicating between two different technology stacks.

For the C# side, you'll probably want to set up a TcpListener. This won't answer all of your questions, but it will get you started:

TcpListener Class (System.Net.Sockets) | Microsoft Docs[^]

For the Android side, this should get you started:

Sending and Receiving Data with Sockets · codepath/android_guides Wiki · GitHub[^]

If you don't already have the knowledge, you'll need to learn about sockets communication and make sure that your firewalls / permissions are set up (on both sides) to allow the communication.

Another option you can explore is WCF, though not sure how well this will cooperate with Android, which is why I mention it last.

Hello World, Basic Server/Client Example of WCF[^]
 
Share this answer
 
v2
Comments
BatLine 11-Aug-18 16:25pm    
I was thinking of something like this... But I really need your help I can't get it to work... Is there any way we could message somewhere where you could help me out with the android part...?
https://www.youtube.com/watch?v=9Rwopuah2Q0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900