3

I am writing a Windows C# (winforms) app that copies images from a PC to the Android device Images folder. Windows file explorer gives me this path: Computer\SCH-I535\Phone\Images but I cannot access the device programmatically via the path.

I am not sure how to mount or read the Android device from my C# app. I's sure this is dead-simple, but I haven't had any luck.

Could anyone help?

Mikos
  • 8,455
  • 10
  • 41
  • 72
  • 1
    Already asked here: http://stackoverflow.com/questions/16762215/c-sharp-file-manipulation-galaxy-s3-sd-card Isn't there a USB drive mode for the Galaxy? – spender Jul 09 '13 at 18:52
  • I only see an Media Device (MTP) and Camera (PTP) options on my S3. – Mikos Jul 09 '13 at 18:57

2 Answers2

1

I did a quick search and found

   var drives = DriveInfo.GetDrives();

   var removableFatDrives = drives.Where(
    c=>c.DriveType == DriveType.Removable &&
    c.DriveFormat == "FAT" && 
    c.IsReady);

   var andriods = from c in removableFatDrives
           from d in c.RootDirectory.EnumerateDirectories()
           where d.Name.Contains("android")
           select c;

Found here: Source

after that you move to the directory where you want to place the files and you can transfer files with you files with:

   String LocalPC_FileLocation = "C://mydoc//mylocation//imagefile";


   File.Move(LocalPC_FileLocation , locationofandroiddirectory );
Community
  • 1
  • 1
Mickey Sly
  • 429
  • 2
  • 6
  • 21
  • 2
    This only works if the Android storage can be mapped to a drive letter, which is not what the OP described. – Aximili Nov 01 '13 at 08:59
  • My case "Computer\Sony Xperia tipo\Internal Storage" and "Computer\Sony Xperia tipo\SD Card" - http://stackoverflow.com/questions/18297207/access-file-on-my-android-phone-from-c-sharp – Kiquenet Apr 22 '14 at 21:50
1

this Library will help you communicating with any android Device

http://forum.xda-developers.com/showthread.php?t=1512685