Template:Android12

From FriendlyELEC WiKi
Jump to: navigation, search

1 Work with Android

Android include the following features:

  • There are two versions, TV and Tablet;
  • Support infrared remote control (only for models with Ir Receiver);
  • Support Bluetooth remote control (requires USB or M.2 Bluetooth module);
  • Support wired network;
  • Support WiFi (requires external USB or M.2 WIFI module);
  • Support video hard decoding;

AndroidTV12.png

1.1 WiFi models supported by Android

1.1.1 M.2 WiFi Module

  • RTL8822CE
1.1.1.1 Usb Dongle
  • RTL8821CU (Vid: 0BDA, Pid: C811) (Test sample:TP-Link TL-WDN5200H)
  • RTL8812AU (Vid: 0BDA, Pid: 8812)
  • MediaTek MT7662 (Vid: 0E8D, Pid: 7612) (Test sample:COMFAST CF-WU782AC V2)

1.2 Bluetooch models supported by Android

1.2.1 Bluetooth Adapters

  • RTL8822CE
  • RTL8761B
  • CSR8510 A10 Bluetooth Dongle 0a12:0001

(Note: unsupported device ID 0x2B89:0x8761)

1.2.2 Bluetooth Remote

  • Amazon Fire TV Remote

1.3 How to use ADB

1.3.1 USB connection

Please note: After turning on the ADB, the USB3 port will work in Device mode, if you need to connect a device such as a USB stick, you need to turn off the ADB and restart the board
In general, ADB is disabled by default, please follow the steps below to enable it:

  • Connect your development board to your computer using a USB A-to-A data cable, referring to the figure below, be sure to connect it to the USB port closest to the edge:

1.3.2 For Android Tablet

  • Go to Settings -> About tablet -> tap the "Build number" at the bottom of the screen 7 times in a row;
  • Go to Settings -> System -> Advance -> Developer options, check USB-Debugging, and then reboot;
  • To use ADB over the network, you need to connect to WiFi first, then enable Wireless debugging. In the prompt "Allow wireless debugging on the network", select "Always allow on this network", and then click "Allow".

1.3.3 For Android TV

  • Click the Settings icon -> Device Preferences -> About -> tap the "Android TV OS build" at the bottom of the screen 7 times in a row;
  • Click the Settings icon -> Device Preferences -> Developer options, check USB-Debugging, and then reboot;
  • To use ADB over the network, on Android TV, which supports both WiFi and wired networks, enable network ADB by checking "Internet ADB" on the "Developer options" UI.

1.3.4 Using ADB

  • Install ADB drivers and commands based on your operating system;
  • Normally, the Android status bar will prompt "USB debugging connected", indicating that ADB has been enabled. Enter the following command on your computer to check the connection:
$ adb devices
List of devices attached
27f7a63caa3faf16	device
  • Enter adb shell:
$ adb shell
nanopi3:/ $

1.3.5 Using ADB over the network

  • On an Android Tablet, go to Settings -> System -> Advance -> Developer options, then click on Wireless debugging to view the IP address and port.
  • The default network ADB port for Android TV is 5555.

Assuming the IP address and port displayed on the Wireless debugging interface are 192.168.1.167:45055, the ADB commands are as follows:

  • To connect to the device:
$ adb connect 192.168.1.167:45055

connected to 192.168.1.167:45055

  • To enter ADB shell:
$ adb shell
nanopi3:/ $

If there are multiple devices, use the -s parameter to specify the device's IP and port, as shown below:

$ adb -s 192.168.1.167:45055 shell
nanopi3:/ $

1.4 How to Change Default Launcher in Android TV

  • Refer to the previous section to enable adb
  • For example, install the third-party launcher Emotn UI via APK, visit the website https://app.emotn.com/ui/ to download the APK, and then install it using ADB:
$ adb install com.oversea.aslauncher_1.0.9.0_5094.apk
Performing Streamed Install
Success
  • After the installation is complete, launch it, and then enter the following ADB command to obtain its package name:
$ adb shell dumpsys window | grep mCurrentFocus
mCurrentFocus=Window{7a950fb u0 com.oversea.aslauncher/com.oversea.aslauncher.ui.main.MainActivity}
  • As you can see, the package name of Emotn UI is com.oversea.aslauncher, set it as the default launcher:
$ adb shell pm set-home-activity com.oversea.aslauncher
Success
  • Then comes the critical step, you need to disable the native launcher using the following command:
$ adb shell pm disable-user --user 0 com.google.android.tvlauncher
Package com.google.android.tvlauncher new state: disabled-user
  • Finally, restart the device to see the effect, the device should boot directly into Emotn UI:
$ adb shell reboot
  • From now on, if you want to install another launcher, you can switch between them through the GUI. for example, after installing FLauncher, you can enter the following settings interface to set FLauncher as the default launcher: Settings -> Device Preferences -> Advanced setting -> Default Launcher:

Androidtv-default-launcher.png

1.5 Wired networks on Android

  • Any network port can connect to the network via DHCP
  • If you want to configure a static IP, only eth0 interface is supported
  • Some applications may have compatibility issues and report no network connection error, but the network is actually connected

1.6 EC20 4G LTE module on Android

EC20 support is disabled by default, you can check the status with the following command, if the EC20 is disabled, the number 1 will be displayed:

su
getprop persist.vendor.radio.no_modem_board

To enable EC20, use the following command (takes effect after a reboot):

su
setprop persist.vendor.radio.no_modem_board 0