Programmatically access files on an Android device from a PC

I have a C # application that will need to access the files that are on my Android tablet, it is obvious that I can just use the attached drive letter for storage, but I will deploy it in several places and you need a consistent way access to files. I can invoke ADB programmatically, but again, I deploy it in several places and cannot install the SDK on each system.

So, I think I also want: 1) program access to the device using C # (or java) or 2) Use ADB without having to install the SDK in every place or 3) Program the drive letter of the connected device programmatically

As you might have guessed, I'm trying to make it as seamless as possible.

PS An example of an application that works this way is HTC Sync, if anyone knows how this application will be perfect.

+5
source share
1 answer

Here is what I came up with for you, maybe starting with.

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;
0
source

All Articles