mtp

How to get IWMDMStorageControl interface for given PIDL

扶醉桌前 提交于 2019-12-02 21:59:48
问题 I use SHBrowseForFolder() to select a folder on MTP device. Then I want to copy file from/to there. IWMDMStorageControl interface (from Windows Media Format 11 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 IPortableDeviceContent interface for given PIDL) 回答1: We can get the displayed name, associated with the PILD from SHBrowseForFolder() in this way: TCHAR

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

给你一囗甜甜゛ 提交于 2019-12-02 21:41:35
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. I just tried this on my Nexus 5 (Android 6.0.1) and it worked: Make sure your phone is NOT connected to any device over USB cable Go to Settings - Developer options

How to get IWMDMStorageControl interface for given PIDL

混江龙づ霸主 提交于 2019-12-02 12:12:11
I use SHBrowseForFolder() to select a folder on MTP device. Then I want to copy file from/to there. IWMDMStorageControl interface (from Windows Media Format 11 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 IPortableDeviceContent interface for given PIDL ) We can get the displayed name, associated with the PILD from SHBrowseForFolder() in this way: TCHAR DisplayName[MAX_PATH]; // we will get it here LPITEMIDLIST pidlSelected = SHBrowseForFolder( &bi ); if (

Issues traversing through directory hierarchy with Android Storage Access Framework / DocumentProvider using MTP

流过昼夜 提交于 2019-12-02 05:29:54
UPDATE: My initial question may be misleading so I want to rephrase it: I want to traverse through the hierarchy tree from an MTP connected device through Android's Storage Access Framework. I can't seem to achieve this because I get a SecurityException stating that a subnode is not a descendant of its parent node. Is there a way to workaround this issue? Or is this a known issue? Thanks. I'm writing an Android application that attempts to traverse and access documents through the hierarchy tree using Android's Storage Access Framework (SAF) via the MtpDocumentsProvider . I am more or less

Accessing an MTP device in Visual Basic .NET

匆匆过客 提交于 2019-12-01 00:31:20
Are there any libraries available for VB.net which will enable me to easily access a MTP device? I'd like to be able to find out what devices are connected, list the contents of them and copy files to and from them. Everything I've seen so far (either at Stack Overflow, on the Microsoft site or with a simple Google search) is either in C++, C# or some other language that isn't VB.net. The Microsoft documentation goes completely over my head. As a result, it's all non-starter unless I plan to learn a new language. I did find MTPSharp which gave me hope. However there is no documentation, it

Accessing an MTP device in Visual Basic .NET

微笑、不失礼 提交于 2019-11-30 19:42:01
问题 Are there any libraries available for VB.net which will enable me to easily access a MTP device? I'd like to be able to find out what devices are connected, list the contents of them and copy files to and from them. Everything I've seen so far (either at Stack Overflow, on the Microsoft site or with a simple Google search) is either in C++, C# or some other language that isn't VB.net. The Microsoft documentation goes completely over my head. As a result, it's all non-starter unless I plan to

Flush MTP connection with Android tablet?

。_饼干妹妹 提交于 2019-11-29 14:38:32
I connect a Samsung Galaxy Android tablet with a USB cable to computer running Windows 7. It connects using MTP. Step 1. Copy my SQLite database from Windows 7 to tablet via Windows Explorer. Step 2. Open it on the tablet (which adds the android_metadata table) and then close it. Step 3. Copy the SQLite database back to Windows. Step 4. Check it using sqlite3.exe. It's corrupt. Now another test. Step 1. Copy my SQLite database from Windows 7 to tablet via Windows Explorer Step 2. Disconnect then reconnect the USB cable. Step 3. Open it on the tablet (which adds the android_metadata table) and

Flush MTP connection with Android tablet?

◇◆丶佛笑我妖孽 提交于 2019-11-28 08:30:53
问题 I connect a Samsung Galaxy Android tablet with a USB cable to computer running Windows 7. It connects using MTP. Step 1. Copy my SQLite database from Windows 7 to tablet via Windows Explorer. Step 2. Open it on the tablet (which adds the android_metadata table) and then close it. Step 3. Copy the SQLite database back to Windows. Step 4. Check it using sqlite3.exe. It's corrupt. Now another test. Step 1. Copy my SQLite database from Windows 7 to tablet via Windows Explorer Step 2. Disconnect

How to manage files on an MTP Portable Device?

左心房为你撑大大i 提交于 2019-11-28 07:03:39
I have been researching this topic for days and I can't find anything on managing files on a MTP Portable Device (More specifically a Galaxy S4). I want to be able to... Copy files from the PC to the MTP Device Copy files from the MTP Device to the PC Delete files from the MTP Device I really want to copy MP3 files but if there is a general way to copy over and file supported by MTP that would be awesome. I've looked into the Window Portable Device API but I couldn't find anywhere where there is sample code in C#. Any blogs, sample code, and files would be very helpful. Thanks! :) Krivers Very

Android: How to detect a change in MediaStore when connected over MTP

99封情书 提交于 2019-11-28 06:39:03
I have big problems with MediaStore. I need to handle events when MediaStore is changed over MTP. I already have a receiver for android.intent.action.MEDIA_SCANNER_FINISHED action, but it is useful only for Universal Mass Storage(UMS). The scanner is not launched over MTP, because the MTP changes the MediaStore database directly. Please would you be so kind and help me how to detect this events. Thank you very much for any help! I finally found a solution. I tried to use FileObserver but when you use it for all directories...it is quite memory consuming. So now I am using ContentObserver and