-
Notifications
You must be signed in to change notification settings - Fork 36
Home
Ralf Beckers edited this page Nov 8, 2017
·
6 revisions
Media Devices is a API to interact with MTP (Media Transfer Protocol) devices like cell phones, tablets and cameras.
To get started, add the MediaDevices package to your project.
Call MediaDevice.GetDevices() to get a list of all currently available MTP devices.
Call device.Connect() to connect to the MTP device.
var devices = MediaDevice.GetDevices();
using (var device = devices.First(d => d.FriendlyName == "My Cell Phone"))
{
device.Connect();
device.CreateDirectory(@"\Phone\Documents\Temp");
using(FileStream stream = File.OpenRead(@"C:/Temp/Test.txt"))
{
device.UploadFile(stream, @"\Phone\Documents\Temp\Test.txt");
}
device.Disconnect();
}
See the MediaDevices.chm for more information.