Android 4.x
Android 4.0 (api 14) and following are officially supported. Theoretically, support of USB
host
functions since Android 3.1. But be aware that the Yoctopuce Java for Android API is regularly tested
only from Android 4 onwards.
USB
host
support
Naturally, not only must your machine have a USB port, this port must also be able to run in
host
mode. In
host
mode, the machine literally takes control of the devices which are connected to it. The
USB ports of a desktop computer, for example, work in
host
mode. The opposite of the
host
mode is
the
device
mode. USB keys, for instance, work in
device
mode: they must be controlled by a
host
.
Some USB ports are able to work in both modes, they are
OTG
(
On The Go
) ports. It so happens
that many mobile devices can only work in
device
mode: they are designed to be connected to a
charger or a desktop computer, and nothing else. It is therefore highly recommended to pay careful
attention to the technical specifications of a product working under Android before hoping to make
Yoctopuce modules work with it.
Unfortunately, having a correct version of Android and USB ports working in
host
mode is not enough
to guaranty that Yoctopuce modules will work well under Android. Indeed, some manufacturers
configure their Android image so that devices other than keyboard and mass storage are ignored,
and this configuration is hard to detect. As things currently stand, the best way to know if a given
Android machine works with Yoctopuce modules consists in trying.
Supported hardware
The library is tested and validated on the following machines:
• Samsung Galaxy S3
• Samsung Galaxy Note 2
• Google Nexus 5
• Google Nexus 7
• Acer Iconia Tab A200
• Asus Tranformer Pad TF300T
• Kurio 7
If your Android machine is not able to control Yoctopuce modules natively, you still have the
possibility to remotely control modules driven by a VirtualHub on another OS, or a YoctoHub
2
.
19.4. Activating the USB port under Android
By default, Android does not allow an application to access the devices connected to the USB port.
To enable your application to interact with a Yoctopuce module directly connected on your tablet on a
USB port, a few additional steps are required. If you intend to interact only with modules connected
on another machine through the network, you can ignore this section.
In your
AndroidManifest.xml
, you must declare using the "USB Host" functionality by adding
the
<uses-feature android:name="android.hardware.usb.host" />
tag in the
manifest
section.
<
manifest ...
>
...
<
uses
-
feature android
:
name
=
"android.hardware.usb.host"
/>;
...
</
manifest
>
When first accessing a Yoctopuce module, Android opens a window to inform the user that the
application is going to access the connected module. The user can deny or authorize access to the
device. If the user authorizes the access, the application can access the connected device as long as
2
Yoctohubs are a plug and play way to add network connectivity to your Yoctopuce devices. more info on http://
www.yoctopuce.com/EN/products/category/extensions-and-networking
19. Using the Yocto-Display with Android
114
www.yoctopuce.com
Содержание Yocto-Display
Страница 1: ...Yocto Display User Manual...
Страница 2: ......
Страница 40: ...34 www yoctopuce com...
Страница 52: ...46 www yoctopuce com...
Страница 84: ...78 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...22 High level API Reference 152 www yoctopuce com On failure throws an exception or returns a negative error code...
Страница 422: ...416 www yoctopuce com...
Страница 424: ...24 Characteristics 418 www yoctopuce com...