Home Accessories Connecting an Android phone to a computer via USB like a flash drive. How to connect a USB flash drive to an Android tablet and smartphone - transfer files using an external flash drive Application for Android testing usb flash drives

Connecting an Android phone to a computer via USB like a flash drive. How to connect a USB flash drive to an Android tablet and smartphone - transfer files using an external flash drive Application for Android testing usb flash drives

Today, modern devices play a huge role in our lives. We are not talking about computers or laptops, which are already beginning to gradually fade into the background. Smartphones and tablets are portable computers that have almost all the functions of laptops. Unfortunately, these modern devices are not suitable for office work. Typing text on a tablet is quite difficult, let alone on regular phones.

People began to wonder how to connect a flash drive to an Android smartphone or a keyboard, mouse and other useful devices. It turns out it can be done. However, not everyone knows how to connect an additional device to their smartphone. Let's look at this using the example of a regular flash drive. As a rule, this is the device that many people try to connect to their device.

How to connect a flash drive to an Android smartphone

Modern devices running the Android operating system have a standard microUSB connector. For a USB flash drive to work on your device, it must have USB On-The-Go technology installed. Manufacturers began implementing this feature in Android OS from version 3.1.

As a rule, modern tablets, and especially phones, do not have a USB connector. Therefore, you will need a USB-OTG cable. Some manufacturers include an adapter for a flash drive in the kit; if you don’t have one, you’ll have to buy it at any store that sells digital equipment.

The smartphone does not have a micro-USB connector

If you do not find a microUSB connector on your smartphone, you will need to first purchase a USB-OTG cable and then an adapter for it. Of course, this is quite inconvenient: if you need to connect an additional device, you will have to use several cables. But this is the only way that will allow you to connect a flash drive.

How to view the contents of an external drive

So, we looked at how to connect a flash drive to an Android smartphone. Now we move on to opening an additional device. How to do it? We need to download a file manager. You may already have it, since in some devices the manufacturer installs a certain set of programs. Of course, if you don't have a file manager, you'll have to install it. For smartphones running Android OS, the leading places are occupied by ES File Explorer, FX File Explorer and Total Commander. You can choose the application that you like best.

How to open a flash drive on Android

As we have already found out, we will need After installing it, we can go to this utility and find the flash drive. If you can't find the external device, try entering the file path (/sdcard/usbStorage). After successfully opening the flash drive, you can view, copy and move files just like on a regular computer. Now you know how to connect a flash drive to an Android smartphone and open it, but, unfortunately, problems arise on some devices. Let's look at them and try to find ways to solve them.

Android tablet or smartphone does not see the flash drive

If you have reached this point, then you are having problems connecting the flash drive to your smartphone. This can happen for various reasons. Now we will look at the most common of them.

First. If the file manager should help him. Now there are applications that can solve this problem. The most effective program is a paid one, so we will look at a free alternative. Unfortunately, it requires root rights. StickMount works not only with flash drives, but also with other additional devices.

If you have installed the necessary utility, you can connect an external device. When connecting, you must agree to the StickMount rules, after which it will automatically start and see the flash drive. How to find a device? You can go to /sdcard/usbStorage/sda1 in the file manager. Do not forget to properly disconnect additional devices so that there are no problems with them in the future. To do this, go into the program and click on the “Unmount” button.

It is worth noting another high-quality application - Helper, which works on a similar principle.

The second reason. Before installing additional programs and root rights, you should make sure that the problem is not with the flash drive. What is this connected with? Your device simply does not see the flash drive, since it may be configured with a different file system (perhaps NTFS).

Let's say you don't have a laptop or computer: how then to connect an additional device? You need to download Paragon NTFS & HTS+ - an application that supports the desired format for reading text data. Unfortunately, this application requires root access. You can get them using the King Root program. However, you may not be able to obtain superuser rights on all devices. Remember: you do this at your own peril and risk. Because of this application, your smartphone may not work correctly. If the device is still under warranty, then you do not need to get root rights, since the warranty will be lost in this case.

Conclusion

So, we looked at how to connect an external flash drive to an Android smartphone, and described some problems associated with the connection. As practice shows, issues arise on older devices. If you have a new device, there should be no problems. To use a flash drive, keyboard, mouse or other applications on your device, you must follow the rules and do everything carefully.

Now I will teach you how to connect an Android phone via USB to a computer as a drive and thus enable data transfer and transfer information without using a flash drive. Very comfortably.

This article is suitable for all brands that produce phones on Android 9/8/7/6: Samsung, HTC, Lenovo, LG, Sony, ZTE, Huawei, Meizu, Fly, Alcatel, Xiaomi, Nokia and others. We are not responsible for your actions.

Attention! You can ask your question to a specialist at the end of the article.

What is MTP mode and where did USB mode go?

Before Android 4.4 KitKat, it was possible to connect via USB as a flash drive. The PC saw the device as a removable disk and provided the same rights: the user could also perform other actions.

Then, in new versions of Android, the USB mode was replaced by MTP, in which only the data transfer function remained, and the same formatting did not work.

Setting up a phone connection to a PC via USB

To manage the connection to a computer via USB, you need. To do this, add the “For Developers” section to the Android settings (if it doesn’t exist):

  1. Open settings.
  2. Go to the "About phone" or "About device" section.
  3. "Build number" or "MIUI version".
  4. Press (click) on this item until you see a message that you have become a developer (usually 7-10 clicks are enough).
Increase

After the developer section appears in the settings, you can enable USB debugging. The item is called that way, so you just need to move the slider to the “On” position and confirm the resolution.


Increase

Now you can connect the device to your computer via USB and select the operating mode. In the latest versions of Android, the most used ones are:

  • MTP - transfer any files from computer to phone and vice versa.
  • PTP - transfer of photos, as well as transfer of files not supported in MTP mode.
  • Charging only.

Connecting in USB storage mode

If you can't get used to using the media player, go back to using USB storage mode. For this you will need:

  • USB MASS STORAGE Enabler installed.

Using this method may damage system files. In this case, you will have to reflash Android.

To connect Android to your computer as a drive:

  1. Launch USB MASS STORAGE Enabler.
  2. Grant superuser rights and agree to change how Selinux works.
  3. If the device is supported, the main application menu will open.
  4. Click "Enable USB MASS STORAGE".

Increase

Now, when connected to a PC, the phone or tablet will appear as a drive. To connect in MTP or PTP mode, just restart the device. Once you're done with mass storage mode, go back into the app and disable USB MASS STORAGE.

Not all users know that you can connect a regular flash drive to your Android smartphone. Moreover, owners of top-end smartphones may not need this function, but for those who have a budget device there are a lot of different benefits from this.

For example, if you have little built-in memory, then you can connect a flash drive and watch movies or listen to music from it. Or you need to transfer some important information from a flash drive to your device, but you don’t have a PC at hand.

In general, this useful “trick” has a lot of applications and, of course, we won’t consider them all. We are more interested in how exactly to connect a USB drive to your gadget.

Checking support for the OTG protocol

OTG protocol is a technology with which you can connect not only a flash drive, but also any other peripheral device to your Android smartphone - a mouse, printer, video camera, etc. More details about this.

To check whether your gadget supports this technology, use the USB OTG Checker application, which can be downloaded.

USB OTG cable

This cable is an “adapter” at one end, which has a standard mini USB connector for connecting a smartphone, and at the other end there is a regular USB port for connecting a flash drive. We simply connect both devices with this cable and don’t need to do anything else.


USB OTG drive

It’s even easier if you purchase in advance a universal flash drive that can be directly connected to both a PC and an Android without any additional “adapters.”

Important! The flash drive must be formatted in FAT32. If it is in NTFS format, then the device on Android OS will simply not see it.

Conclusion

That's all: you shouldn't have any difficulties connecting a USB flash drive to your device. Ask any additional questions in the comments, and we will definitely answer!

USB OTG File Manager for Nexus allows you to open and copy files from any USB storage device with the FAT32 or NTFS file system using the USB OTG port. You can copy files to any storage device and manage them: edit file names, add directories and delete files.

You can also manage your files in the device's internal memory. The application was developed for Nexus devices that have the "OnTheGo" port. But it is also possible to work on any device with an OTG USB port and Android 4.0+

Instructions

  • 1. install the USB OTG File Manager program.
  • 2. connect the flash drive to your device via an OTG cable.
  • 3. Allow the application to become the default for opening flash drives.
  • 4. Click CONNECT in the program and wait for the connection.
  • 5. using the program...
  • 6. Before exiting the program, press the special shutdown button (see screenshot).

Add. information

  • 1. When connecting and launching for the first time, allow the application to become the default for opening flash drives.
  • 2. With FAT32 file system, read and write is available. With the NTFS file system, read-only is available.
  • 3. Supports opening files directly from a USB device.
  • 4. The application may offer to install additionally Simple Music Player for playing music. Whether to bet or not is up to you. I didn't put it.
  • 5. The application has an Advanced Mode for advanced users. If you are not confident in your actions, then use a normal gun (Normal Mode).
  • 6. The application does not transmit or receive any data from the Internet, which is good.

Download the application for working with a flash drive - USB OTG File Manager for Nexus on Android you can follow the link below.

Developer: KyuuDrod
Platform: Android 4.0 and higher
Interface language: Russian (RUS)
Status: Full
Root: Not needed




Fig. 1 Illustration of the operation of an Android device in USB Host and Accessory modes (picture from the site http://developer.android.com)

Note that using USB is not the only way to communicate with the same homemade device. Android also allows you to use NFC, Wi-Fi P2P, SIP, as well as a standard network connection. So the developer has enough opportunities in his arsenal to realize his wildest ideas.

Another common option for communicating with various devices is still the use of a USB-COM adapter. There is material on the Internet on using a USB-COM adapter in Android - see, for example,. The popularity of this connection is due to the presence of a large number of devices already developed using various microcontrollers, communication with which is carried out using a COM port (serial port), which 10 years ago was an almost standard way to transfer data from a computer to a homemade piece of hardware.

Compared to a COM port, using USB can significantly increase data transfer speeds and make this process more user-friendly. Transfer speed, which even in the case of low-speed devices (keyboards, mice, joysticks), is 10-1500 Kbps, simplicity and low cost of the cabling system and connections, self-identification of devices with automatic configuration, hiding details of the electrical connection from the end user (plus the ability disconnecting the cable without turning off the devices), error control and their recovery at the protocol level - these are the undeniable advantages of this technology (see, p. 12).

In general, speaking about the use of USB for data transfer, it would be useful to mention P. Agurov’s book “USB Interface”. Although it is often criticized on the Internet and was last released in 2006, it has more than once helped to find the right solution when searching for information on various aspects of the application of this technology. The book covers issues from choosing a microcircuit and circuit design for the controller to writing a microcontroller program and examples of programming data transfer via the USB protocol from the computer. It is impossible not to indicate the “primary source” of data on this issue - the website of the non-profit organization USB IF (USB Implementers Forum), which is developing specifications for this interface -, although this material is in English. However, it is there that you will find comprehensive information about the USB interface device. There is a good translation of parts of the specification - . Those interested in software solutions from the microcontroller side can also see the link.

This article is addressed primarily to those who have any electronic device (developed independently or by someone else), the data exchange protocol with which is well known (for example, there is already a program that works with this device in Windows/Linux) and would like I would like to have a program that works with it in Android.

A little about USB device classes

It should be noted that the development of software for communicating with a specific device is highly dependent on its implementation at the microcontroller level. For obvious reasons, it is impossible to provide examples of communication programs for all types of USB devices in one article (initial information about programming various types of devices can be found in). However, we will limit ourselves to presenting code that implements device search and access to its control points for information exchange. We will also analyze sending data using the example of one of the types of USB devices, namely, the HID (human interface device) class of devices. This class includes “slow” devices such as a keyboard, mouse, joystick, and there are plenty of examples of its implementation using various microcontrollers on the network (there are, for example, in).

Why is the HID class so popular among manufacturers of various home-made devices? To quote Wikipedia: “In addition to detailed specifications of classic input devices (such as keyboards and mice), the HID standard defines a special class of devices without detailed specifications. This class is called USB HID Consumer Control and is essentially an unregulated communication channel with a device. In this case, the device uses the same standard drivers for the operating system as a mouse and keyboard. Thus, it is possible to create a USB device that does not require the creation and installation of special drivers in most common computer operating systems." It only remains to add that this specification also works in the Android OS (not excluding CyanogenMod firmware).

One of the options for exchanging data with an HID device is interrupt transfer, which is used when it is necessary to transfer small data packets (the maximum packet size depends on the transfer rate and ranges from 64 to 1024 bytes) after a specified time interval. The package for transmission is called a report (English - report, see pp. 71, 95). This length of a report is usually quite enough to exchange information with a homemade device; 64 bytes of information in one packet, for example, is quite a lot for a controller, because 1 bit of information is enough to transmit the states of an LED or a simple sensor.

Required Tools

So, we will need a tablet or phone with Android version no lower than 3.1. It should be noted here that the above USB Host API is not fully implemented on all mobile devices (this is also mentioned on the developer.android.com website, see link). In some tablets/phones, the USB connector is used only for charging and communication with a personal computer. Once again I will refer the reader to the list of mobile devices suitable or unsuitable for our experiments (see).

You will also need some kind of USB device (for the first experiments, a regular USB flash drive will be enough), an OTG adapter (On-The-Go - see Fig. 2) and/or a USB cord for communication with the device. Wikipedia says about OTG: “When connecting via USB OTG, the rank of the device (master or slave) is determined by the presence or absence of a jumper between pins 4 and 5 in the connecting cable plug. In a USB OTG cable, such a jumper is installed only in one of the two connectors (see). Accordingly, we need such a jumper on the side of the mobile device.


Fig.2 Differences in the circuit of a regular USB cable and an OTG cable (picture from http://tech.firstpost.com)

You can solder such an OTG cable for your device yourself. To do this, you need to buy a suitable connector at a radio store, plus the author, for example, used an old cable from a portable hard drive:

The USB Device Info program installed from the Google Play Market storage will also be a good help in your work. The program can detect devices connected to the USB connector of a tablet/phone using both the Java API and the Linux kernel. That is, if your device is not detected using the Java USB Host API in USB Device Info, then, most likely, it will be in vain to use any (including your own) Android program written using Java for this mobile device and USB Host API.

Sometimes, the information output by the lsusb command of the Linux operating system is also very useful. With the -v and -d switches, lsusb displays everything, or almost everything, about a USB device that a software developer needs for devices of this class (see Fig. 3).


Fig.3 Example output of lsusb and lsusb -v -d commands

Next, you need a computer with the Android SDK installed and the Eclipse integrated development environment (IDE) with the ADT plugin (although you can get by with just the SDK). You can see how to create and install an application for Android, for example, in, or on the Internet.

And, of course, you need at least the desire to achieve results, without it you can’t! I note that it took the author weeks of painstaking search for information to clarify some technical issues regarding the use of USB in Android.

Java classes for working with USB in Android API

So, as they say on the website of the developers of the USB Host API for Android (see) - “before you start, it is important to understand what classes you will use in your work.” Table 1 provides a description of the most important classes for working with the USB Host API (an attempt to translate information from http://developer.android.com).

Table 1. Description of classes for working with USB in Android

Class name Description
USBManager Allows you to enumerate and communicate with connected USB devices.
Allows you to detect a connected USB device and exchange data with it.
USBDevice Represents a connected USB device and contains methods to access its identifying information, interfaces, and endpoints.
Represents a connected USB device and contains methods for accessing its identity, interfaces, and endpoints.
USB Interface Represents an interface of a USB device, which defines a set of functionality for the device. A device can have one or more interfaces on which to communicate on.
Represents the "interface" of a USB device, which defines the set of functions for that device. One device may have one or more interfaces for exchanging information.
USBEndpoint Represents an interface endpoint, which is a communication channel for this interface. An interface can have one or more endpoints, and usually has input and output endpoints for two-way communication with the device.
Represents the "endpoint" of an interface, which is the communication channel for that interface. An interface can have one or more endpoints, and usually has endpoints for receiving information and for transmitting it.
USBDeviceConnection Represents a connection to the device, which transfers data on endpoints. This class allows you to send data back and forth sychronously or asynchronously.
Represents a "connection" to a given device. Required to transfer data to the endpoint. This class allows you to receive or transmit data synchronously or asynchronously.
USBRequest Represents an asynchronous request to communicate with a device through a UsbDeviceConnection.
Represents an asynchronous request to communicate with a device via a UsbDeviceConnection.
USBConstants Defines USB constants that correspond to definitions in linux/usb/ch9.h of the Linux kernel..
Defines constants that correspond to the definitions in linux/usb/ch9.h of the Linux kernel.

In almost all cases of using the USB Host API, the programmer uses these classes in his work. The algorithm for their use looks something like this: we define devices (the goal is programmatic access to the UsbDevice class) connected to the host (mobile device) using UsbManager. When software access to a device is obtained, it is necessary to determine the appropriate UsbInterface and UsbEndpoint to communicate with it. Once you have the endpoint in your possession, open UsbDeviceConnection to communicate with the USB device. If the endpoint operates in asynchronous transfer mode, we use the UsbRequest class.

Let's try to figure it all out by creating a simple application that, using this API, will detect a device connected to the host running Android OS and display some information about it on the screen of a phone or tablet.

Create a project

In Eclipse, a project is created using the File->New->Android Application Project menu items. Note also that the code below is borrowed from example applications supplied with the Android SDK (folder android sdk samples/android-N(API Level)/USB) we are talking about the Missile Launcher USB toy control program (see Fig. 4 ) Sample applications are downloaded via Android SDK Manager (check the box - Samples for SDK). In the listings below, the code examples are provided with comments that explain what is happening.


Fig.4 Fun toy "Rocket Launcher"

When creating a project, do not forget to check the required API Level in the Minimum Requared SDK option (API Level 12, corresponding to Android version 3.1 /Honeycomb/, or higher). The project will have a very simple user interface - the main window (Activity) and TextView for displaying information. A similar project is discussed in detail in.

In the automatically created class for the Activity of our project, it is necessary to define the following instances of classes for working with USB:

private TextView lgView;
private UsbManager mUsbManager;
private UsbDevice mDevice;
private UsbDeviceConnection mConnection;
private UsbEndpoint mEndpointIntr;

LgView = (TextView) findViewById(R.id .logTextView ) ;

and get access to the UsbManager class

MUsbManager = (UsbManager) getSystemService(Context .USB_SERVICE ) ;

Let's also create an onResume() event handler. Let's achieve the goal - so that information about connected devices is updated when our application window is activated (see Listing 1).

Listing 1. OnResume() event handler

public void onResume() (
super.onResume();

//fill the container with a list of devices
HashMap< String , UsbDevice>deviceList = mUsbManager.getDeviceList();
Iterator< UsbDevice>deviceIterator = deviceList.values().iterator();

lgView.setText("Devices Count:" + deviceList.size());

while (deviceIterator.hasNext()) (
UsbDevice device = (UsbDevice) deviceIterator.next () ;

//example of determining the ProductID of a device
\n"+ "Device ProductID: " + device.getProductId());
}
//define the intent described in the filter
// intent AndroidManifest.xml
Intent intent = getIntent() ;
lgView.setText (lgView.getText() + " \n"+ "intent: " + intent);
String action = intent.getAction();

//if the device is connected, pass the link to
//to the setDevice() function
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE) ;
if (UsbManager.ACTION_USB_DEVICE_ATTACHED .equals (action) ) (
setDevice(device) ;
lgView.setText (lgView.getText() + " \n" + "UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action) is TRUE") ;
) else if (UsbManager.ACTION_USB_DEVICE_DETACHED .equals (action) ) (
if (mDevice != null && mDevice.equals (device) ) (
setDevice(null) ;
lgView.setText (lgView.getText() + " \n" + "UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action) is TRUE") ;
}
}

Next, we will create the setDevice() function for the Activity, which is necessary to work with our device (see Listing 2). In the onResume() handler and in the setDevice() function, we exactly followed the algorithm for using the USB Host API described in the previous section.

Listing 2. setDevice() function

private void setDevice(UsbDevice device) (
lgView.setText (lgView.getText() + " \n"+ "setDevice " + device);

//determine available device interfaces
if (device.getInterfaceCount() != 1 ) (

LgView.setText(lgView.getText()+" \n"+ "could not find interface" ) ;
return ;
}
UsbInterface intf = device.getInterface(0);

//define device endpoints
if (intf.getEndpointCount() == 0 ) (

LgView.setText(lgView.getText()+" \n"+ "could not find endpoint" ) ;
return ;
) else (
lgView.setText (lgView.getText() + " \n"+ "Endpoints Count: " + intf.getEndpointCount () ) ;
}

UsbEndpoint epIN = null ;
UsbEndpoint epOUT = null ;

//look for endpoints to transmit via interrupts
for (int i = 0 ; i< intf.getEndpointCount () ; i++ ) {
if (intf.getEndpoint(i).getType() == UsbConstants.USB_ENDPOINT_XFER_INT) (
if (intf.getEndpoint(i).getDirection() == UsbConstants.USB_DIR_IN) (
epIN = intf.getEndpoint(i) ;
lgView.setText (lgView.getText() + " \n"+ "IN endpoint: " + intf.getEndpoint (i) ) ;
}
else(
epOUT = intf.getEndpoint(i) ;
lgView.setText (lgView.getText() + " \n"+ "OUT endpoint: " + intf.getEndpoint (i) ) ;
}
) else ( lgView.setText ( lgView.getText() + " \n" + "no endpoints for INTERRUPT_TRANSFER") ; }
}

MDevice = device;
mEndpointIntr = epOUT;

//open the device for data transfer
if (device != null ) (
UsbDeviceConnection connection = mUsbManager.openDevice (device) ;
if (connection != null && connection.claimInterface (intf, true ) ) (

LgView.setText(lgView.getText()+" \n"+ "open device SUCCESS!" ) ;
mConnection = connection;

) else (

LgView.setText(lgView.getText()+" \n"+ "open device FAIL!" ) ;
mConnection = null ;
}
}
}
}

In addition to the above code, which, as the attentive reader has probably guessed, opens the device for receiving and transmitting data, all that remains is to use the data exchange protocol, which, I repeat, should be well known to the developer. We will only present, as promised, the code that will send a certain message data packet to the HID device using interrupt transmission, the UsbRequest class and the corresponding endpoint - see Listing 3.

Listing 3. Example code for sending data to a device

//determining the size of the buffer to send
//based on the maximum packet size
int bufferDataLength = mEndpointIntr.getMaxPacketSize () ;

lgView.setText (lgView.getText() + " \n"+ mEndpointIntr.getMaxPacketSize());

ByteBuffer buffer = ByteBuffer.allocate (bufferDataLength + 1 ) ;

UsbRequest request = new UsbRequest() ;

buffer.put(message);

request.initialize(mConnection, mEndpointIntr) ;

request.queue(buffer, bufferDataLength) ;

if (request.equals(mConnection.requestWait()) )

//sending was successful
//lgView.setText(lgView.getText() + "\n" + "sending CLEAR!!!");

catch (Exception ex)

//Is there something wrong...
//lgView.setText(lgView.getText() + "\n" + "sending not clear...");

Device filtering in AndroidManifest.xml

Although our application does not need to search for a specific device with a known VID (Vendor-ID) and PID (Product-ID), Google engineers do not provide examples of applications without an intent-filter section in the manifest file, and the author was unable to get the program to work without filtering devices in AndroidManifest.xml.

Let me remind you that Vendor-ID and Product-ID are unique identifiers of USB devices. That is, using filtering, you can create an application that interacts only with a certain device or some class of devices. Please note that device manufacturers must agree on these numbers with the USB IF organization.

An application whose manifest file is shown in Listing 4 and whose filter condition file is in Listing 5, for example, successfully recognizes USB flash drives connected to a mobile device, but does not recognize the keyboard and mouse that the author has. This application along with the source code can be downloaded from the link.

Listing 4. AndroidManifest.xml file


" > http://schemas.android.com/apk/res/android"
> package="ru.learn2prog.usbhostexample"
android:versionCode="1"
android:versionName="1.0" >


android:minSdkVersion="12"
android:targetSdkVersion="14" />


android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

android:name= "ru.learn2prog.usbhostexample.MainActivity"
android:label="@string/app_name" >
>

"android.intent.category.DEFAULT" />

"android.intent.category.LAUNCHER" />

>

>

>
"android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
>
>

>

Listing 5. Filter file device_filter.xml (/res/xml directory)

>

>

The operations for assembling and installing our application are no different from ordinary ones (see examples in,). I would like to draw your attention to the actions of the intent filter - when a device is connected to the host, the OS asks the user to launch our application.

Literature/References: 11.
12.
13. http://developer.android.com/guide/topics/connectivity/usb/host.html - overview of the classes required to work with USB in Android
14. link to application sources

New on the site

>

Most popular