Connecting two devices with different scenes - c#

I'm implementing a game in Unity and I have a problem that I need advise for. I want to connect a tablet and a computer. The scene that is on the computer is supposed so send an event once an object is collected so that a special scene can be shown on the tablet. So based on what is happening on the computer there is a different scene shown on the tablet.
I only have no idea how to achieve that.

First, you need to create 2 different applications (for desktop and mobile). Second, you need to determine what protocol you want to connect desktop app and mobile app. The easiest way to implement this I think by using WebSocket/internet but not HTTP. Yes, you need to write code for the backend so it likes creating 3 different apps. But you can use firebase to simplify this process.
I recommended you use firestore from firebase. Connect booth app to firestore. When desktop app sends data to firestore, firebase will automatically notify mobile app and send that data. But you need to figure out yourself how to pair a desktop app and a mobile app otherwise, your firestore will receive data from all connected desktop app and send the same data to all connected mobile app.
This tutorial to use firestore:
https://www.youtube.com/watch?v=b5h1bVGhuRk
But before that, you need to add firebase to your project before you add firestore:
https://firebase.google.com/docs/unity/setup
You can use any wireless protocol available. You can even use Bluetooth if you want your app offline. But I don't know how to use Bluetooth...

Related

Bypassing connect bluetooth device permission in c# with windows 10

Context: I'm working on a Windows 10 app that will allow users to quickly connect to a Bluetooth device. Because the native API is difficult to work with, I'm using the 'In The Hand' library. Anyway, back to the point: whenever I make a connect request. Before allowing me to connect, I receive this Pair a device notification.
I'm wondering if I can set Windows to automatically accept this permission for connecting the device. Is there a method in the Windows API that I can use to accomplish this?
Here is the link to the code: https://github.com/hasham7861/bluetooth-le-experiment/blob/master/Program.cs
In the picture I make a connect request to a bluetooth headset and then I get the notification on the bottom right, and only if I click allow to pair device then it pairs the device.
I hope this link helps you.
I apologize in advance if I misunderstood the question or if the data were meaningless
Windows 10 Connect to Bluetooth Classic Device without Pairing
https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs

I want to send a string from an android device to a windows machine over wifi with c#. Is this possible?

I want to make a program that transmits strings from an Android device, to the web or directly to my PC.
Do note that the android and windows device are connected to the same wifi if this makes a difference. The problem here is that I do not know how to send strings from one device to another. I am thinking of doing it in a txt file and then reading it with the program on my PC (Which I have already tested), but I don't know how to transmit it.
Yes, you can share a data from cross platform devices. There are many methods to do it. I would personally recommend using Web APIs using asp.net core, the consume that Web API in your android application, it can be in Xamarin, and for Desktop you can used HttpClient package to consume either in WPF or Winform.

Send commands remotely to mobile app in Xamarin C#

I am developing a mobile (Xamarin.IOS) and a desktop app (C# Winforms) for our small start-up for internal use. I want to be able to send commands (not remote notifications) to the client (mobile app) through our main desktop app.
For example; I want all our employees using our mobile app to perform certain task, let's say, show a popup window with specific text when they open up the app. Any ideas about how to implement such kind of thing? Is is technically possible to tell a device to remotely execute certain management commands?
Thanks in advance.
There are multiple ways of doing this.
A Microsoft MVP, Mark Arteaga, suggests using Azure Functions-HTTP Triggers to do this. He presented this in multiple Microsoft events and also has a Github repo where he implements it in a sample mobile app.
So whenever you need to, you would send commands through Azure Functions to the client using similar, and if you want to go one step further, you can even look into implementing it with Backgrounding using Shiny

Mobile App to Work Along side a Winform C#

Ive made a Windows Form Application and all is working fine on that.
but what im trying to do is make it so people have a mobile App(that ill end up making) that will allow them to be away from the PC and push a button on the mobile app that will send someform or command to the Winform Application and get it to trigger a button click event.
E.G
Winform is open on PC has a button on it that will play or pause music.
I go get a drink downstairs and i want to pause the music from the mobile app.
Push the button on the mobile app and it connects to the Winform application and triggers the event for the pause button.
If anyone can help me out with this or put me in the right direction to do somthing like this that would be great. thank you.
Ben
Basically what you just described is that you need to build a mobile application.
There are several tools that allow you to move your application to web. I used to work with these guys, they were called Artinsoft at the time but they are now called Mobilize.net, and they have a tool for making this conversion: www.mobilize.net/press/topic/convert-windows-to-web
However in your cases it seems like what you are trying to build is a remote control, in this case you need to either expose an endpoint for a mobile app to connect to or create a centralized server that both the remote and Winforms connect to.
I suggest using a TCP/IP connection. I don't know anything about mobile development, so I'll just focus on .NET and the concepts should carry-over.
System.Net.Sockets contains TCP classes for opening connections to hosts/clients. I'd recommend that the desktop-app acts as the host while the mobile-app is the client.
There are plenty of online articles on the subject, so take one and explore it's code until you understand it. Then, prototype your task on a single desktop machine using two-different .NET programs, one for the host (mimics the desktop program in the final project) and the other as the client (mimics the mobile-app in the final project). Then, learn the mobile API for networking and mimic what you did in the client-test program on-to the mobile platform project.

Sync data between C# and iphone app

What I am looking for is an offline sync between a C# app running on a PC and an app on the iPhone connected to it.
Is this possible at all?
Is there a way to use iTunes app to access iPhone data.
Can ActiveSync or any other API to sync data between PC and device.
You need to have a server or wcf service which is called to pass data between two apps

Categories