Android USB Connections Explained: MTP, PTP, and USB Mass Storage

Older Android devices support USB mass storage for transferring files back and forth with a computer. Modern Android devices use the MTP or PTP protocols — you can choose which one you prefer.

To select a USB connection protocol, open the Settings app, tap Storage, tap the menu button, and tap USB computer connection. You’ll also see the protocol your device is using as a notification when it’s connected to a computer via USB.

 

Why Modern Android Devices Don’t Support USB Mass Storage

USB mass storage — also known as “USB mass storage device class,” USB MSC, or UMS — was the way older versions of Android exposed their storage to a computer. When you connected your Android device to your computer, you’d have to specifically tap a “Connect storage to PC” button to make the Android device’s storage accessible to the computer over USB mass storage. When disconnecting it from the computer, you’d have to tap a “Turn off USB storage” button.

USB mass storage is the standard protocol used by flash drives, external hard drives, SD cards, and other USB storage devices. The drive makes itself completely available to the computer, just as if it were an internal drive.

There were problems with the way this worked. Whatever device is accessing the storage needs exclusive access to it. When you connected the storage to the computer, it was disconnected from the Android operating system running on the device. Any files or apps stored on the SD card or USB storage would be unavailable when it was connected to the computer.

System files had to be stored somewhere; they’d never be disconnected from the device, so you ended up with Android devices containing separate /data partitions for “system storage” and /sdcard partitions for “USB storage” on the same internal storage device. Android installed apps and its system files onto /data, while user data was stored on the /sdcard partition.

Because of this hard split, you might end up with too little space for apps and too much space for data, or too little space for apps and too much space for data. You couldn’t resize these partitions without rooting your device — the manufacturer chose the appropriate amount for each partition at the factory.

RELATED ARTICLE

HTG Explains: Why Are Removable Drives Still Using FAT32 Instead of NTFS?
Microsoft’s Windows XP started using the NTFS file system by default for its internal drives back in 2001. It’s now...[Read Article]

Because the file system had to be accessible from Windows device, it had to be formatted with the FAT file system. Not only doesMicrosoft have patents it exerts on FAT, FAT is also an older, slower file system without a modern permission system. Android can now use the modern ext4 file system for all its partitions because they don’t need to be directly readable by Windows.

Connecting an Android phone or tablet to a computer as a standard USB storage device is convenient, but there are too many downsides. The craziness had to stop, so modern Android devices use different USB connection protocols.

MTP – Media Device

MTP stands for “Media Transfer Protocol.” When Android uses this protocol, it appears to the computer as a “media device.” The media transfer protocol was widely promoted as a standardized protocol for transferring audio files to digital music players using Windows Media Player and similar applications. It was designed to allow other media player companies to compete with Apple’s iPod and iTunes.

This protocol works very differently from USB mass storage. Rather than exposing your Android device’s raw file system to Windows, MTP operates at the file level. Your Android device doesn’t expose its entire storage device to Windows. Instead, when you connect a device to your computer, the computer queries the device and the device responds with a list of files and directories it offers. The computer can download a file — it will request the file from the device, and the device will send the file over the connection. If a computer wants to upload a file, it sends the file to the device and the device chooses to save it. When you delete a file, your computer sends a signal to the device saying, “please delete this file,” and the device can delete it.

Android can choose the files it presents to you, and hide system files so you can’t see or modify them. If you attempt to delete or edit a file that can’t be modified, the device will refuse the request and you’ll see an error message.

Your computer doesn’t need exclusive access to the storage device, so there’s no need to connect the storage, disconnect it, or have separate partitions for different types of data. Android can also use ext4 or any other file system it wants — Windows doesn’t have to understand the file system, only Android does.

In practice, MTP functions a lot like USB mass storage. For example, an MTP device shows up in Windows Explorer so you can browse and transfer files. Linux also include offers for MTP devices via libmtp, which is generally included with popular desktop Linux distributions. MTP devices should appear on your Linux desktop’s file manager, too.

Apple’s Mac OS X is a holdout — it doesn’t include MTP support at all. Apple’s iPod, iPhone, and iPad use their own proprietary syncing protocol along with iTunes, so why would they want to support a competing protocol?

Google provides an Android File Transfer application for Mac OS X. This application is just a simple MTP client, so it will work for transferring files back and forth on a Mac. Google doesn’t provide this application for other operating system because they include MTP support.

PTP – Digital Camera

PTP stands for “Picture Transfer Protocol.” When Android uses this protocol, it appears to the computer as a digital camera.

MTP is actually based on PTP, but adds more features, or “extensions.” PTP works similarly to MTP, and is commonly used by digital cameras. Any software program that supports grabbing photos from a digital camera will support grabbing photos from an Android phone when you select the PTP mode. PTP was designed to be a standard protocol for communicating with digital cameras.

In this mode, your Android device will work with digital camera applications that support PTP but not MTP. Apple’s Mac OS X does support PTP, so you can use PTP mode to transfer photos from an Android device to a Mac over a USB connection without any special software.


If you have an older Android device, you may be forced to use USB mass storage. On a modern Android device, you have a choice between MTP and PTP — you should use MTP unless you have software that only supports PTP.

If your device has a removable SD card, you can remove the SD card and insert it directly into your computer’s SD card slot. The SD card will be available to your computer as a storage device, so you can access all the files on it, run file-recovery software, and do anything else you can’t do with MTP.

Android USB Connections Explained: MTP, PTP, and USB Mass Storage的更多相关文章

  1. android的USB MTP && USB CDC/USBnet(ECM, NCM, ACM) && USB gardget

    MTP的全称是Media Transfer Protocol(媒体传输协议),它是微软公司提出的一套媒体文件传输协议.早在智能手机普及前,数码相机和MP3播放器等都使用了MTP的前身PTP(Pictu ...

  2. Atitit mtp ptp rndis midi协议的不同区别

    Atitit mtp ptp rndis midi协议的不同区别 1. PTP:1 2. MTP:1 3. Mtp 与usb区别2 4. 不过和UMS相比,MTP也有不足之处:3 5.  MTP协议介 ...

  3. 你的USB设备还安全吗?USB的安全性已从根本上被打破!

    前言: USB设备使用方便,但也可能被用来携带恶意软件.病毒,感染计算机系统.通过禁用自动播放功能.杀毒软件查杀.不定期的对设备进行格式化等操作可以确保它是干净的.但它存在的安全问题要比我们想象的更深 ...

  4. USB Tethering always displays grey when USB tethering type is Linux(EEM)

    USB Tethering always displays grey when USB tethering type is Linux(EEM) 1.Problem DESCRIPTION USB T ...

  5. usb mass storage device

    Problem adding USB host device to KVM Windows guest machine. Status: CLOSED CURRENTRELEASE   Aliases ...

  6. Linux usb子系统(二):USB设备驱动usb-skeleton.c

    usb驱动分为通过usbfs操作设备的用户空间驱动,内核空间的内核驱动.两者不能同时进行,否则容易引发对共享资源访问的问题,死锁!使用了内核驱动,就不能在usbfs里驱动该设备. 下面转载的一篇分析u ...

  7. USB系列之二:读取USB设备的描述符

    在前面的文章中,我们已经给出了USB协议的链接地址,从这篇文章起,我们会涉及到许多USB 1.1的内容,我们的指导思想是先从熟悉USB 1.1协议入手,先使用现成的HCD和USBD,直接面对客户端驱动 ...

  8. USB Mass Storage学习笔记-STM32+FLASH实现U盘

    一.内容概述  采用STM32内部自带USB控制器外加大页NAND FLASH K9F1G08U0A实现一个128M的U盘. 1.STM32的USB控制器 STM32F103的MCU自带USB从控制器 ...

  9. usb mass storage之旅

    前面总结了usb hid keyboard,现在总结usb mass storage,在枚举阶段没什么好总结的,hid和mass storage差不多,都是同样的枚举过程,但是在他们的配置描述符.接口 ...

随机推荐

  1. b.BIO连接器整体框图

    上一讲讲解过NIO的框图,可以看来,NIO通道是目前Tomcat7以后的默认的通道的推荐配置,在Tomcat6和以前的配置中,BIO是主流的配置: 只需要修改protocol协议部分即可,而后续还有A ...

  2. 【转】 C++ map的基本操作和使用

    1.map简介 map是一类关联式容器.它的特点是增加和删除节点对迭代器的影响很小,除了那个操作节点,对其他的节点都没有什么影响.对于迭代器来说,可以修改实值,而不能修改key. 2.map的功能 自 ...

  3. 有关Flash Player的内存管理及泄露检测

    1.Flash Player分配内存的策略是少量请求大内存块, 也就是不会频繁向系统请求内存. 2.Flash Player内存的回收是根据引用计数和标记清除(比较耗cpu)这两种方法. 3.从理论上 ...

  4. 關於my97datepicker

    原因的一篇是比較老的版本了 目前使用4.72 目前碰到一種情況就是使用了PopUpForm.js,也就是在頁面中彈出一個框,用來編輯,或者添加數據等功能. 使用知道時間會出現一種情況.時間顯示被ifr ...

  5. LINUX&UNIX 安装vmware workstation10和centOS6

    大一下时,学习了linux&unix这门课程,全字符的操作,我对它并不是很感冒,不过,还是找学长安装过虚拟机和Linux系统,在考前利用它和putty进行复习.现在重装系统之后,各类软件,自然 ...

  6. hdu----(4301)Divide Chocolate(状态打表)

    多校综合排名前25名的学校请发送邮件到HDUACM@QQ.COM,告知转账信息(支付宝或者卡号) Divide Chocolate Time Limit: 2000/1000 MS (Java/Oth ...

  7. struts2视频学习笔记 13-14(自定义局部和全局类型转换器(转换Date格式))

    课时13 自定义类型转换器 局部(对某个action类) package tutorial; import java.util.Date; public class HelloWorld { priv ...

  8. XHR2 和[FromBody]使用说明

    [FromBody]必须是application/json 否则会报415 不支持的类型 //Forms function FormsPost(data) { //Default Type x-www ...

  9. 使用PL/SQL连接远程的Oracle数据库

    PL/SQL不仅可以连接本机的oracle数据库.也可以连接远程的数据库. 需要修改一个文件:在本机oracle 数据库的安装目录下找到这个文件: /oracle/ora92/network/admi ...

  10. c#网络通信框架networkcomms内核解析之八 数据包的核心处理器

    NetworkComms网络通信框架序言 本文基于networkcomms2.3.1开源版本  gplv3协议 我们先回顾一个 c#网络通信框架networkcomms内核解析之六 处理接收到的二进制 ...