Switch branches/tags
Nothing to show
Find file History
devunwired Change packaging category.
Bug: 79346240
Change-Id: Ieaf76593be97e9b494b45d74e1eee3e3c1875d78
Signed-off-by: Dave Smith <smithdave@google.com>
Latest commit ec2f151 May 18, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.google Change packaging category. May 18, 2018
app sample-usbenum: clean up manifest Apr 10, 2018
gradle/wrapper Add Kotlin version. Mar 31, 2018
CONTRIBUTING.md Add Kotlin version. Mar 31, 2018
LICENSE Add Kotlin version. Mar 31, 2018
README.md Make launch behavior optional. Apr 5, 2018
build.gradle Add Kotlin version. Mar 31, 2018
gradle.properties Add Kotlin version. Mar 31, 2018
gradlew Add Kotlin version. Mar 31, 2018
gradlew.bat Add Kotlin version. Mar 31, 2018
settings.gradle Add Kotlin version. Mar 31, 2018

README.md

USB Enumerator Sample (Kotlin)

This application demonstrates accessing the UsbManager Android API from within an Android Things application. The sample application iterates over all the USB devices discovered by the host and prints their interfaces and endpoints.

Screenshots

USB Enumerator sample demo

(Watch the demo on YouTube)

Pre-requisites

  • Android Things compatible board
  • Android Studio 2.2+

Getting Started

Import the project using Android Studio and deploy it to your device. The application prints the list of connected USB devices. Connect any USB peripheral to one of the host ports on your device. The application connects to that specific device, parses its descriptors, and prints out more detailed information about its configuration.

Behavior Differences

The Android USB Host APIs behave differently on Android Things because user-granted permission dialogs are not enabled. This sample takes these changes into account, and does not request device access permissions that would otherwise be required on an Android mobile device.

Enable auto-launch behavior

This sample app is currently configured to launch only when deployed from your development machine. To enable the main activity to launch automatically on boot, add the following intent-filter to the app's manifest file:

<activity ...>

    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.HOME"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>

</activity>

License

Copyright 2017 The Android Open Source Project, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.