mtp

How to get IPortableDeviceContent interface for given PIDL

纵饮孤独 提交于 2019-12-11 14:22:05
问题 I use SHBrowseForFolder() to select a folder on MTP device. Then I want to copy file from/to there. IPortableDeviceContent interface (from Windows Portable Devices SDK) seems suitable, but how to get it for the object with PIDL, returned from SHBrowseForFolder()? (I asked similar question about obtaining IWMDMStorageControl interface: How to get IWMDMStorageControl interface for given PIDL) 回答1: We can get the displayed name, associated with the PILD from SHBrowseForFolder() in this way:

shell32 copyhere not working neither in .Net nor powershell script

南笙酒味 提交于 2019-12-11 07:34:17
问题 There is a powershell script to copy files between pc and android via MTP programmatically,see access-file-system-against-mtp-connection,and it works when it running under powershell console,then i have made a script as below: function Usage() { echo "Usage:mtpcmd cp srcfile dstfolder" } function main { param($mainargs) # echo "args2:$mainargs" if(-not($mainargs.length -eq 2)) { Usage return } $srcfile=$mainargs[0] $dstfolder=$mainargs[1] $phone = Get-ChildShellItem | where { $_.Path -like '

How to reliably copy items with PowerShell to an mtp device?

半世苍凉 提交于 2019-12-10 19:25:19
问题 I want to be able to copy items (files, folders) from a Windows PC to an MTP device. I want to do it with PowerShell for scripting purposes. I found this thread: shell32 copyhere not working neither in .Net nor powershell script but the answer there does not help understanding the solution (and was given by the same person who asked that question). Below there is a minimal code example: param ($itemName) $shell = New-Object -com Shell.Application $sourceFolder = $shell.Namespace($(Get

Copy files with WPD to Windows Phone C#

断了今生、忘了曾经 提交于 2019-12-07 07:21:05
问题 I want to copy at least one file to a windows phone via MTP. I am able to connect to the phone and copy files from the phone to the computer following this tutorial: WPD: Transferring Content However I am unable to copy files the other way round (from computer to phone). This is my code: IPortableDeviceContent content; this._device.Content(out content); IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); PortableDeviceApiLib.IStream tempStream; uint

.Net MTP / PTP Wrapper?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 19:26:02
问题 I'm writting a hobby project to deal with files on cameras. Previously I found issues with the camera and the FolderBrowserDialog. What I believe is happing is that the camera is using MTP or PTP (Picture Transfer Protocol not peer-to-peer). In order to make interfacing with the camera more seamless I'd like to use PTP or MTP to access the camera. Are there any MTP / PTP Wrappers for .Net people can recommend? I'm keen to avoid writing my own or dabbling in unmanaged code if possible. 回答1: I

Copy files with WPD to Windows Phone C#

房东的猫 提交于 2019-12-05 12:50:26
I want to copy at least one file to a windows phone via MTP. I am able to connect to the phone and copy files from the phone to the computer following this tutorial: WPD: Transferring Content However I am unable to copy files the other way round (from computer to phone). This is my code: IPortableDeviceContent content; this._device.Content(out content); IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); PortableDeviceApiLib.IStream tempStream; uint optimalTransferSizeBytes = 0; content.CreateObjectWithPropertiesAndData( values, out tempStream, ref

.Net MTP / PTP Wrapper?

五迷三道 提交于 2019-12-04 02:42:57
I'm writting a hobby project to deal with files on cameras. Previously I found issues with the camera and the FolderBrowserDialog . What I believe is happing is that the camera is using MTP or PTP (Picture Transfer Protocol not peer-to-peer). In order to make interfacing with the camera more seamless I'd like to use PTP or MTP to access the camera. Are there any MTP / PTP Wrappers for .Net people can recommend? I'm keen to avoid writing my own or dabbling in unmanaged code if possible. I have found this blog post by dimeby8 which has been a great starting point with a lot of useful information

Desktop java app copy and transfer android data via USB

烈酒焚心 提交于 2019-12-03 13:54:44
问题 I have a desktop java app, and also an android app. Two app work together. The user in desktop app have a button to launch the transfer between device data app to computer app and vice versa. So I need to transfer data with a simple USB cable, and without internet connection/WiFi/Bluetooth/adb. I found two Java MTP library that works on Windows to resolve my problem, and the USB Host/accesory fonctionnality of android: jMTP successfully recognizes my Android devices, folder, and other things

How to set Android M default USB config to MTP rather than “charging only”?

余生长醉 提交于 2019-12-03 08:08:20
问题 Whenever my device (Nexus 5, Android M Preview 3) connects via USB, the USB config always defaults to "charging only". This is quite problematic because the USB port on my device is faulty and sometimes disconnects and reconnects when bumped and so I have to manually change the mode to MTP (media transfer protocol) from the notification drawer each time. Debugging mode is enabled Develop settings -> USB Configuration is set to MTP. 回答1: I just tried this on my Nexus 5 (Android 6.0.1) and it

Desktop java app copy and transfer android data via USB

こ雲淡風輕ζ 提交于 2019-12-03 03:50:36
I have a desktop java app, and also an android app. Two app work together. The user in desktop app have a button to launch the transfer between device data app to computer app and vice versa. So I need to transfer data with a simple USB cable, and without internet connection/WiFi/Bluetooth/adb. I found two Java MTP library that works on Windows to resolve my problem, and the USB Host/accesory fonctionnality of android: jMTP successfully recognizes my Android devices, folder, and other things I have success to transfer a file in computer ---> device, but i have an error when i try to transfer a