android-things

Powering off Android Things

…衆ロ難τιáo~ 提交于 2019-11-28 08:54:33
Usually, to power down an Android device, you do this via the power button of course. You can also do adb shell and reboot -p . But in Android Things , I don't see a way to shut down the device. If it is no problem, I'd love to just cut the power of my Raspberry Pi for this, but is that acceptable? Could it corrupt the SD-card? Android (and by extension, Android Things) should have no problem with a sudden loss of power. The core operating system is housed in read-only partitions on the file system, so there is no risk of corrupting the OS from a failed in-flight write. Also, reboot -p should

Android Things: Raspberry Pi screen timeout

流过昼夜 提交于 2019-11-28 05:25:36
问题 I'm building app on Raspberry Pi with Android Things and I have 7 inch touch screen, but the screen never turns off. Is it possible to set timeout like in Android phones? or force it to turn off/on. If I remove the power line and inserted again the screen, it will not work until I reboot. 回答1: There are two system settings that control this process: STAY_ON_WHILE_PLUGGED_IN and SCREEN_OFF_TIMEOUT The STAY_ON_WHILE_PLUGGED_IN setting is set to BATTERY_PLUGGED_AC by default. You can

Android Things: ADB over USB on Raspberry Pi

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:40:54
I'm playing with Raspberry Pi 3 Model B and Android Things . I was able to configure everything (connect Pi over Ethernet , then reconnect over Wi-Fi with Android.local ) and debug the app. However it's not convenient sometimes to debug over Wi-Fi when I travel and I have to change Wi-Fi networks or don't have Wi-Fi connection at all. I know there is serial debug console , but it seems to be for getting logs and shell commands, not for debugging. Any chance to have direct debugging over USB cable just like any other Android device like smartphone/tablet? The NXP i.MX7D development board has

How to mount a USB drive on Android Things?

社会主义新天地 提交于 2019-11-27 19:26:57
问题 I'm attempting to read files off of a USB drive for an Android Things app on a Raspberry Pi . I'm able to scan the list of mounted devices like so: public static List<File> ScanForFiles(Context context){ ArrayList<File> files = new ArrayList<>(); try{ BufferedReader reader = new BufferedReader(new FileReader("/proc/self/mountinfo")); String line; while ((line = reader.readLine()) != null) { String[] columns = line.split(" "); Log.i(TAG, "Mounted: " + columns[4]); //files.addAll(getListFiles

UART peripherals on Android Things for Raspberry Pi 3

五迷三道 提交于 2019-11-27 15:09:40
How do I use UART peripherals on Android Things for Raspberry Pi 3? It seems that by default it is assigned the linux console. proppy By default the UART port is mapped to the linux console, in order to prevent the kernel message from messing around with your peripheral. You can disable the console by mounting the boot partition from the sdcard on your host computer using: mount /dev/sdX1 /mnt/disk where sdX is replaced with your sdcard reader device name (running dmesg after inserting your sdcard into your reader should help you figure out the device name). Then edit /mnt/disk/cmdline.txt to

PeripheralManagerService throws NoClassDefFoundError

自闭症网瘾萝莉.ら 提交于 2019-11-27 08:03:34
问题 I have the following code in my app to access PeripheralManagerService : PeripheralManagerService service = new PeripheralManagerService(); Gpio ledGpio; try { ledGpio = service.openGpio("BCM6"); ledGpio.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW); } catch (IOException e) { Log.e(TAG, "Error configuring GPIO pins", e); } After updating to the latest Android Things (Developer Preview 7), my app is now throwing a NoClassDefFoundError : java.lang.NoClassDefFoundError: Failed resolution of:

Android Things with Rasp3 7 inch touchscreen

 ̄綄美尐妖づ 提交于 2019-11-27 07:56:24
问题 I have Android Things OS image installed for my Rasp3 and successfully booted up and log in to shell using adb, but lcd display is upside down with my 7 inch touchscreen display. I wonder if there is config like lcd_rotate=2 in /boot/config.txt on Raspbian? 回答1: You can try to manually mount the boot partition from the sdcard and edit config.txt mount -t msdos /dev/sdX1 /mnt/disk echo 'lcd_rotate=2' >> /mnt/disk/config.txt Where /dev/sdX1 points to your sdcard reader device. Note: This is

What is Android Things Raspberry Pi GPIO max frequency?

↘锁芯ラ 提交于 2019-11-27 07:20:57
问题 Where can be found the characteristics of the switching speed of GPIO port for the Raspberry Pi 3 under Android Things like that? 回答1: In DP2 there is two ways to control GPIO: 1) with SDK using java (analyzed by Harry Fairhead here); 2) with NDK using C/C++ (analyzed by Harry Fairhead here). With SDK using java the fastest pulses seen are around 0.23ms and there are lots of large (up to 8ms) interruptions (!!!) in the pulse train. And with NDK using C/C++ the pulse width is reduced from 0

Android Things: display isn't working

孤街醉人 提交于 2019-11-27 04:48:26
问题 Earlier I was using my RaspberryPi with Waveshare LCD and Raspbian was installed so there was no issue with display, but now I have Android Things SDK so how can I get display working with it? As Waveshare was providing different image for Raspbian OS, but how to get its driver for Android Things OS? I was following this and this for installation on raspberry-pi. 回答1: As of now Android Things image isn't shipped with a default configuration for display in config.txt file which is located in

How to download android things OS source code?

萝らか妹 提交于 2019-11-27 03:41:37
问题 I could find git repository/branch for Brillio but no separate for Android things. Is it that it is not open source yet or released for public ? 回答1: No because AndroidThings is still in preview as you can see from this link: https://developer.android.com/things/preview/releases.html the source code is not available. There is a GitHub page though with the examples of how things are built on Android Things: https://github.com/androidthings 回答2: cd ~ mkdir IOT cd IOT repo init -u https:/