C#windows表单连接到Android应用程序 [英] C# windows form to connect to android app

查看:71
本文介绍了C#windows表单连接到Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个Windows表单应用程序,在它完成我想做的所有事情的任期内完成。



但我想尝试一下正在制作连接到与Windows窗体应用程序相同的家庭连接的应用程序的移动版本。

和Android应用程序我希望能够举例。按下应用程序上显示登录的按钮。然后在Windows窗体上它触发我在表单中的主登录按钮的点击事件。



所以android应用程序只有按钮触发事件是已经在Windows应用程序中。



任何帮助或Windows应用程序以及Android应用程序的小代码示例都会有很大的帮助。



我尝试了什么:



不是用量已尝试使用TCP但是我所做的一切已经尝试过没有用。

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.

推荐答案

你混淆(或混合)两件不同的事情;服务器 - 客户端架构和远程桌面协议。



首先,您要求提供服务器 - 客户端模型,并要求获取Android内置客户端的示例,该客户端与Windows窗体服务器通信应用。这在很多方面,不可能。在这个论坛上已经讨论了很多次,我想给你一些我以前的答案,很好地回答这个问题。



简答:你需要建立一种沟通机制;在这种情况下,本机TCP通信最好(并且我不相信你的声明尝试使用TCP,但我尝试过的所有内容都没有用,但你可以使用Web API或WCF构建一个弹性的通信框架。



如何将Android App与服务器连接 [ ^ ]

如何将Android数据发送到.Net数据库。 [ ^ ]

如何从Android应用程序调用web apis? [ ^ ]



问题的第二部分甚至更复杂,因为您不仅要尝试连接,还要触发功能并与应用程序交互。这根本不简单。我想给你一个想法,使用你可以在这里使用的任何基于开源远程桌面协议客户端 - 服务器的模型,例如从以下网址开始: FreeRDP [ ^ ],然后在顶部构建并使用它。否则,您没有太多选择。
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.


这篇关于C#windows表单连接到Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆