Click here to Skip to main content
15,908,843 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello i have a windows form application that is finished in the term that it does everything i want it to.

but there is something i would like to try that being making a mobile version of the application that connects to the same home connection as the windows form application.
and from the android app i want to be able to for example. press a button on the app that says Login. then on the windows form it fires the click event i have for the main login button in the form.

so the android app just has buttons that fire the events that are already in the windows application.

any help or a small code example for both windows application as well as android app would be a great help.

What I have tried:

not a use amount have tried to use TCP but everything i have tried has not worked.
Posted
Updated 25-Jan-17 9:38am

1 solution

You are confusing (or mixing) two different things; Server-client architecture and Remote Desktop Protocol.

First of all, you asked for a server-client model, and requested to get an example for a client built in Android that communications with a server that is Windows Forms applications. Which is in many ways, impossible. This has been discussed a lot of times on this forum as well, and I would like to give you a few of my previous answers that answer this question well.

Short answer: You need to develop a mechanism to communicate; native TCP communication is best in this case (and I do not believe your statement of, "tried to use TCP but everything i have tried has not worked", but you can use Web API or WCF to build a resilient framework of communication.

How to connect Android App with Server[^]
How Do I Send Android Data To .Net Database.[^]
How to call web apis from android app ?[^]

Second part of your question is even more complex, as you are trying to not just connect, but also to trigger functions and interact with the application. That is not simple at all. I would like to give you an idea, use any open source remote desktop protocol client-server based model that you can use here, for example start at: FreeRDP[^], then build on top and use it for this. Otherwise, you don't have much options.
 
Share this answer
 
v2
Comments
ben chenapa 25-Jan-17 20:53pm    
so in theory. i could have a database and have a few settings on there like.

LoginButton = 0

then in the app use it to update the 0 to a 1.

Then in the winform app have it keep looking to see if it has changed to a 1 then fire the click event. not efficient but it could work?
Afzaal Ahmad Zeeshan 26-Jan-17 6:53am    
Yes, it could and yes, not very much efficient. You can write services (not Windows Services) that manage the data sources and leave WinForms manage the GUI only.

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