Results 1 to 5 of 5

Thread: How to make Xamarin Android App talk to VB Desktop Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    5

    How to make Xamarin Android App talk to VB Desktop Application

    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.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    108,376

    Re: How to make Xamarin Android App talk to VB Desktop Application

    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.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    37,332

    Re: How to make Xamarin Android App talk to VB Desktop Application

    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.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    5

    Re: How to make Xamarin Android App talk to VB Desktop Application

    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.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,809

    Re: How to make Xamarin Android App talk to VB Desktop Application

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width