access Data on PC by Phone via USB - c#

Is It possible, to get some data via usb from your pc with an app, or must there be another software on the PC that pushes the needed files to the Phone?
to clarify what i mean:
i have a pc with a MySQL Database which is used and maintained by a programm on the pc. what i need are some informations of this DB, so i want to have a button in my app, which says sth. like "Get it!" and then the app connects to the DB via USB, retrieves all the data needed and then displays it on the screen (for example).

Check this question: android phone mount desktop partitions via USB port (Reverse USB Tethering in disk level?) and read the first answer's link, which seems to get into something similar to what you want, albeit not using xamarin.android

Related

How to use Winform C# app to transfer data to Hololens device with USB cable?

I am using Winform C# to make an application with Hololens device.
I hope I can check whether the Hololens device connected to the PC, so that I can tranfer data between Hololens and PC.
I found one solution is that check whether I can access the Hololens internal storage, if can check, the Hololens has connected to the PC.
But I found I can't get the Hololens internal storage, even if I can see the internal storage in the explorer, but I can't get the driver(like C:\ or D:\ ), Hololens internal storage don't have a device number.
What should I do? Is there any better way to check whether Hololens has connected and transfer data between Hololens and PC except Network?
Since there is smiliar project called ADB, is it necessary to develop something like ADB? If so, how should I start?
----------------------------Edit--------------------
I finally found the workable solution:
First, in PC app, I use a library called libusbDotNet which allow you get full control to the USB device like Hololens to send a command to Hololens device
Secondly, in Hololens platform, write a UWP application which can receive data from PC by usb cable, and send response data back to PC
From the discussion. The actual problem is how to get an access to HoloLens filesystem from remote PC.
That could be solved by Windows Device Portal REST API.
But I would recommend to use WindowsDevicePortalWrapper. You should connect to your device by USB or WiFi, and provide an access to it.
Simple code that reads content of one known folder.
static void Main(string[] args1)
{
string DeviceAddress = "http://127.0.0.1:10080/";
DevicePortal Portal = new DevicePortal(new DefaultDevicePortalConnection(DeviceAddress, "user", "pass"));
Portal.ConnectAsync().Wait();
var folders = Portal.GetKnownFoldersAsync().Result.Folders;
var rootDirOfFirstFolder = Portal.GetFolderContentsAsync(folders[0], null).Result.Contents;
Console.WriteLine($"First known folder is {folders[0]}. It contains:");
foreach(var file in rootDirOfFirstFolder)
{
Console.WriteLine($"\t{file.Name}");
}
Console.WriteLine("Press ANY key to continue.....");
Console.ReadKey();
}
The similar staff is for reading/writing files on a device.

Unity3D - Transfer Data between a Mobile and a Desktop Application

I have a desktop application to store various data in a database (up to 10k datasets).
Then i have multiple mobile devices (Android and Apple) to collect data by user-input (up to 2k datasets).
Assuming a not existing wlan or internet connection: what is the best way to transfer or synchronize data between Desktop - Mobile and vice versa ?
I would try to copy the db-file to the mobile device and update the mobile-db via script comparation (slow..).
A) How to access usb-connected mobile storage via desktop-app?
B) How to find, read and write those files on mobile?
Assuming i have wlan if i come home with mobile and dont wanna mess with usb.
C) Transfer data via multiplayer-communication-stuff? Like the two running apps communicate via chat-like system. One dataset per message; then parsed to desktop-db. ... seems also slow.
Best solution would be.. both ^^ the user should be able to choose.
What do u folks think ? :)
If you can tether a hotspot point from your mobile, connect your pc to this network and use sockets or http requests between your applications.

way of communicating between Windows phone app and desktop app

I want my windows phone app to communicate with a desktop app (in Windows), basically i want to send a picture which is captured in the phone to be send to the desktop app and get back the feedback from the desktop app.
Whats the most elegant and modular and simple way of doing this?
If you can force your user to connect via wifi such that he is on the same local network as the desktop, you listen for the phone's connection on a higher port and transfer the data to/from it over TCP directly.
Otherwise, the best way to do this at present would be via the internet, using your server to synchronize files and messages between the two devices.

How to use computer's Bluetooth to send Wallpapers to any cellphone, in C#?

I'd like to know if it is possible how to do it, because my client asked me if the program I'm developing could also send wallpapers to nearby cellphones(my program will be in a place with many people passing by, so it would be good to have the bluetooth feature).
Thanks!
it can send pictures as files, users then may set them as wallpapers.
Unless the phone and the computer support bluetooth and are connected, you cannot. You can send the files to mobiles over bluetooth. 32feet provides a nice library to perform bluetooh related operations. Try that.
Hope it helps.
To do this you would need to
Make sure each user's device is paired to your bluetooth "sever"
Create the ability to auto connect and send the file.
On your phone's application, receive the image file and set the phone background - this will be different for each type of phone's OS. I would assume you are aiming towards Window Mobile Devices, since you are using c#.
The first step i see as being the difficult step as each phone much "register" the bluetooth of the server to be paired with it.

How to cut down ActiveSync functionality on Windows CE device

Is there any way to cut down a specific functions of ActiveSync service on Windows CE device?
I want to see only one specific folder on my device when it's connected to PC.
Basically I want to leave only functionality of exchanging data via a specific folder, without any other communication (deploying applications, synchronization etc.).
I'm using a device with Windows CE 5.0.
ActiveSync really only has 2 "modes" - either with the ability to sync PIM info, or just the ability to connect as Guest. In both modes a user can browse the device from the PC.
What it sounds like you want to do is not include ActiveSync at all, but instead make your device a USB function device that acts as Mass Storage. If you do that you can then set a specific folder to be the mounted store and they would have access to only that folder.
Of course in that scenario you can't use any of the PIM data sync features.

Categories

Resources