question

HBBob-5681 avatar image
0 Votes"
HBBob-5681 asked RobCaplan edited

Xamarin - Android enable MTP programmatically

I have a Xamarin form app targeting Android that runs on a MEMOR 10 device. The user scans barcodes, the app creates a .csv file. The user connects the device to a PC and manually pulls the .csv file off the device. Simple enough... My issue is the default USB connection type for the device is "USB Charging" unless the user changes it to "File Transfer" they can't see the file. I know I can change the default on the device itself but I'd like to be able to do it from my app, is this possible? If so how? Thanks

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

I know I can change the default on the device itself but I'd like to be able to do it from my app, is this possible?

Sorry, it's not possible. Google doesn't support to swich to the MTP mode for a device programmatically because the beavior may cause a huge security vulnerability. This mode can only be enabled manaually.

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.