# Visual Basic > Xamarin >  How to make Xamarin Android App talk to VB Desktop Application

## deanobravo

I have just spent about a week solid creating a Menu/Ordering app for Hospital Patients.
The app works really well except for the most important part. 
There doesn't seem to be any way to get the vb desktop app (which has all the patient info) to talk to my Android app which has the food orders and vice versa.
The Android app needs to know what patients are in what rooms and then send an order to Desktop when created.
If anyone out there has any ideas I would be most grateful.

----------


## jmcilhinney

I don't use Xamarin so maybe I'm wrong but I wouldn't expect that they would talk to each other. They would each talk to the same server. Maybe that server is just a database containing shared data or maybe its something smarter that can push notifications to the app and/or the Windows application.

----------


## Shaggy Hiker

If the two devices are going to be on the same LAN, then you could just use something like UDP or TCP directly. I would expect that Xamarin could do that and the desktop certainly could. It sounds like the information transfer might be well suited for UDP, so TCP might be overkill. However, you (mostly) do need to be on the same LAN for this to work. If they aren't on the same network, behind the same firewall, then you'd be dealing with opening ports in the firewall, which you really don't want to be doing.

This would be a more peer-to-peer approach than what JMC suggested. His solution is somewhat more robust, and could be made to work outside the firewall through something like a WebAPI. It could have some other advantages, as well, such as not needing to have both the Xamarin and desktop applications running simultaneously. The communication on one end wouldn't have to necessarily be at the same time as the communication on the other end. However, it is also a heavier weight solution, as it would require a third device and two channels of communication.

----------


## deanobravo

Thanks Shaggy Hiker, after a quick google, it sounds like UDP might be just the thing. However the week I spent creating this App also included learning C# and Xamarin Forms so I think implementing UDP might be beyond my (very) limited skill set.

----------


## si_the_geek

In that case something along the line of jmcilhinney's idea is probably the way to go.

Presumably you currently have two separate databases (one for the VB app, and one for the Xamarin app), so creating some kind of link between the databases would allow the data to transfer between them as needed.

You could do that by getting each of the apps to talk to both of the databases (which would mean you would need to write code to match the data from one database to the data from the other), but you could also do it by creating a link between the databases (so that you can treat a table from the other database as if it is in the same database).

Creating a link between the databases is probably the easiest option, but exactly how you would do it depends on the kinds of databases involved (eg: an Access mdb file has  different methods to an SQL Server database).

----------

