问题标签 [android-things]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1698 浏览

android - 如何在 Android Things 上录制语音

我正在 RPi3 上开发 Android Things SDK 的 Preview 2。尝试了录音机和媒体录音机,仍然无法捕获音频。我正在尝试将我的语音转换为文本。不支持常规语音识别。我将 USB MIC 直接连接到 RPi3 以及通过 USB 声卡连接到 RPi3 的耳机 MIC。

媒体记录器代码:

清单权限:

错误:

0 投票
1 回答
407 浏览

android - android things UART无法接收数据(RPi3B)

我用我的 RPi3B 在 github 上尝试了 android things UART loopback 示例项目。 https://github.com/androidthings/sample-uartloopback

当我从电脑上的串口调试工具发送数据时,调用了apps的UART回调函数,但UART读取函数无法读取数据,后面的while函数从未进入,读取的参数始终为零。

我单独尝试了 mLoopbackDevice.write() 函数,效果很好。

我也单独尝试了 mLoopbackDevice.read() 函数,仍然没有收到任何数据,但我发现我的串口调试工具总是收到我发送的数据。好像数据是linux系统返回的,androidthings系统接收不到。

我已经在 cmdline.txt 中删除了 console=serial0,115200 以关闭控制台。

我该如何解决?谢谢!

0 投票
2 回答
229 浏览

java - Android 的东西 - 如何在命令 mLedGpio.setValue(true) 后保持 LED 不间断

我完成了这个项目:sample-button 但是我需要将其更改为在按下按钮时保持 LED 亮着,并在再次按下按钮后将其熄灭。

我该怎么做?

0 投票
1 回答
561 浏览

android - 带有 Raspberry Pi 3 的 Android Things - 无法启动启动器

我正在尝试在新网络上设置我的 Android Things 设备并意识到,由于我在设备上预加载了一个应用程序,我永远无法访问启动器,因此永远无法访问通过 ADB 连接所需的 IP 地址. 有没有一种方法可以让我与 Raspberry Pi 交互或访问启动器,这样我就可以将其连接到互联网,而无需擦除 SD 卡并用库存的 Android Things 替换它?

0 投票
1 回答
1548 浏览

adb - 通过以太网电缆将 AndroidThings 连接到 adb

快速提问。可以通过连接到我的笔记本电脑而不是连接到路由器的以太网电缆来获取 adb 吗?

0 投票
3 回答
2899 浏览

android - 将 GSM/GPRS 调制解调器与 Raspberry Pi 3 与 Android things 集成

我正在尝试在 Android Things 的帮助下制作一个模块。我需要借助 GSM/GPRS 调制解调器通过互联网将温度和压力读数发送到服务器。我正在使用带有 AndroidThings SDK 的 Raspberry Pi 3。我可以借助 BMP 280 传感器获取温度和压力读数,但必须使用外部 GSM 调制解调器将数据发送到服务器。是否可以将 GSM 调制解调器与 Android Things(Raspberry pi 3)集成?由于我是 Android Things 和 IoT 的新手,我在哪里可以获得学习和执行此操作的资源?

0 投票
1 回答
266 浏览

raspberry-pi - 如何使 pi-topCEED 屏幕与 Android Things 一起使用

当我使用pi-topCEED尝试Android Things DP3 时,启动屏幕无法正确显示:

开机画面失败

如何使用适当的显示参数配置 Android Things:

  • 解析度:1366x768
  • 刷新率:60hz
0 投票
1 回答
636 浏览

java - 在 2 个 Wifi 网络之间切换,连接失败

我在运行 Android 的 Raspberry Pi 3 上以编程方式在 2 个网络之间切换时遇到问题(但它应该与运行普通 Android 相同)。

第一个网络来自作为接入点的设备服务器。它运行一个 FTP 服务器,我需要通过它的网络访问它。它在我知道的 192.168.xxx.xxx 网络中有一个静态 IP 地址,并受 WPA2-PSK 保护。我有我知道是正确的 SSID 和密码。该设备位于其自己的专用网络中,无法通过外部地址访问。连接到它的唯一方法是连接到它的网络并通过 FTP 连接到它的静态地址。

第二个网络是一个开放网络,我也知道它的 SSID。这个是由另一个应用程序预先配置的,所以我的应用程序无法更新配置。

下面的代码是我目前所拥有的。在我的开始屏幕的 onCreate 中调用了 DownloadFilesTask。

第一个网络的配置似乎失败了,因为将配置添加到 WifiManager 会返回 -1 作为 networkId,正如我在最后两行的日志中看到的那样,在断开连接并丢失所有日志记录之前。2行是:

04-11 11:10:51.258 1332-1349/rocks.androidthings.hellothings D/连接:SSID1 passphase

04-11 11:10:51.259 411-740/system_process I/addOrUpdateNetwork:uid = 10026 SSID SSID1 nid=-1

在此之后我得到一个 java.net.socketException: invalid argument or cannot connect assign requested address。

在过去的几天里,我一直在为此苦苦挣扎,因此将不胜感激。

我用来检索文件的代码是(使用 apache.commons.net):

尝试连接时出现异常,因为我没有连接到网络。

0 投票
1 回答
546 浏览

android - Android Things 3 Cannot read from rxtx on Raspberry PI 3

I have a Arduino configured to keep writing things on TX port, that is connected to my Raspberry Pi 3 with Android Things Developer preview 3 (I am sure that the RX/TX cables are configured right and voltages are OK).

I am trying a long time to read data and write data using PeripheralManagerService of Android Things libs.

There is an error when I start the app:

04-11 16:26:13.665 163-163/? I/peripheralman: type=1400 audit(0.0:44): avc: denied { read write } for name="ttyAMA0" dev="tmpfs" ino=1203 scontext=u:r:peripheralman:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1

04-11 16:26:13.665 163-163/? I/peripheralman: type=1400 audit(0.0:45): avc: denied { open } for path="/dev/ttyAMA0" dev="tmpfs" ino=1203 scontext=u:r:peripheralman:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1

04-11 16:26:13.665 163-163/? I/peripheralman: type=1400 audit(0.0:46): avc: denied { ioctl } for path="/dev/ttyAMA0" dev="tmpfs" ino=1203 ioctlcmd=5401 scontext=u:r:peripheralman:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1

My code:

Someone know what could it be ?

0 投票
1 回答
696 浏览

android - 蓝牙 LE GATT 问题

我对 Android Things 和蓝牙 LE Gatt 还是很陌生。我已经尝试过Google 提供的Bluetooth LE GATT 服务器示例。我在 Raspberry Pi 3 上运行 Bluetooth LE GATT 服务器示例,在手机上运行Android BluetoothLeGatt 客户端示例。我在 SampleGattAttributes.java 和 BluetoothLeService.java 中编辑了一些代码。

SampleGattAttributes.java

BluetoothLeService.java

当我单击当前时间时,它在数据字段中显示 7。我可以知道数字 7 是从哪里来的,为什么我更改时间时没有通知。