Difference between revisions of "Template:Android12"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(6 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
===WiFi models supported by Android===
 
===WiFi models supported by Android===
 
====M.2 WiFi Module====
 
====M.2 WiFi Module====
* RTW8822CE
+
* RTL8822CE
 
=====Usb Dongle=====
 
=====Usb Dongle=====
 
* RTL8821CU  (Vid: 0BDA, Pid: C811)  (Test sample:TP-Link TL-WDN5200H)
 
* RTL8821CU  (Vid: 0BDA, Pid: C811)  (Test sample:TP-Link TL-WDN5200H)
Line 17: Line 17:
 
===Bluetooch models supported by Android===
 
===Bluetooch models supported by Android===
 
====Bluetooth Adapters====
 
====Bluetooth Adapters====
* RTL8761B (Test sample:UGREEN CM390 Bluetooth 5.0 USB Adapter)
+
* RTL8822CE
 +
* RTL8761B
 
* CSR8510 A10 Bluetooth Dongle 0a12:0001
 
* CSR8510 A10 Bluetooth Dongle 0a12:0001
 +
(Note: unsupported device ID 0x2B89:0x8761)
 
====Bluetooth Remote====
 
====Bluetooth Remote====
 
* Amazon Fire TV Remote
 
* Amazon Fire TV Remote
Line 39: Line 41:
 
====For Android Tablet====
 
====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 -> About tablet -> tap the "Build number" at the bottom of the screen 7 times in a row;
* Go to Settings -> System -> Advance -> Developer options, and check the box for USB debugging;
+
* Go to Settings -> System -> Advance -> Developer options, check USB-Debugging, and then reboot;
* 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".
 
====For Android TV====
 
====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 -> 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, and check the box for USB debugging;
+
* Click the Settings icon -> Device Preferences -> Developer options, check USB-Debugging, and then reboot;
* 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.
 
====Using ADB====
 
====Using ADB====
 
* Install ADB drivers and commands based on your operating system;
 
* Install ADB drivers and commands based on your operating system;
Line 58: Line 60:
 
nanopi3:/ $  
 
nanopi3:/ $  
 
</syntaxhighlight>
 
</syntaxhighlight>
===Expanding the Storage Partition===
+
====Using ADB over the network====
If Android is installed on an SD card, after burning the image to the SD card, do not insert it into the target board and start it up. Instead, execute the following commands on a Linux computer to expand the partition first:
+
* 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:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
echo "write" | sfdisk /dev/sdX -q --force
+
$ adb connect 192.168.1.167:45055
parted -s /dev/sdX unit % resizepart 14 100 print
+
</syntaxhighlight>
 +
connected to 192.168.1.167:45055
 +
* To enter ADB shell:
 +
<syntaxhighlight lang="bash">
 +
$ adb shell
 +
nanopi3:/ $
 +
</syntaxhighlight>
 +
If there are multiple devices, use the -s parameter to specify the device's IP and port, as shown below:
 +
<syntaxhighlight lang="bash">
 +
$ adb -s 192.168.1.167:45055 shell
 +
nanopi3:/ $
 +
</syntaxhighlight>
 +
===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:
 +
<syntaxhighlight lang="bash">
 +
$ adb install com.oversea.aslauncher_1.0.9.0_5094.apk
 +
Performing Streamed Install
 +
Success
 +
</syntaxhighlight>
 +
* After the installation is complete, launch it, and then enter the following ADB command to obtain its package name:
 +
<syntaxhighlight lang="bash">
 +
$ adb shell dumpsys window | grep mCurrentFocus
 +
mCurrentFocus=Window{7a950fb u0 com.oversea.aslauncher/com.oversea.aslauncher.ui.main.MainActivity}
 +
</syntaxhighlight>
 +
* As you can see, the package name of Emotn UI is com.oversea.aslauncher, set it as the default launcher:
 +
<syntaxhighlight lang="bash">
 +
$ adb shell pm set-home-activity com.oversea.aslauncher
 +
Success
 +
</syntaxhighlight>
 +
* Then comes the critical step, you need to disable the native launcher using the following command:
 +
<syntaxhighlight lang="bash">
 +
$ adb shell pm disable-user --user 0 com.google.android.tvlauncher
 +
Package com.google.android.tvlauncher new state: disabled-user
 +
</syntaxhighlight>
 +
* Finally, restart the device to see the effect, the device should boot directly into Emotn UI:
 +
<syntaxhighlight lang="bash">
 +
$ adb shell reboot
 +
</syntaxhighlight>
 +
* 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:<br />
 +
[[File:Androidtv-default-launcher.png|600px]]<br />
 +
===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
 +
===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:
 +
<syntaxhighlight lang="bash">
 +
su
 +
getprop persist.vendor.radio.no_modem_board
 +
</syntaxhighlight>
 +
To enable EC20, use the following command (takes effect after a reboot):
 +
<syntaxhighlight lang="bash">
 +
su
 +
setprop persist.vendor.radio.no_modem_board 0
 
</syntaxhighlight>
 
</syntaxhighlight>
Please replace /dev/sdX with the actual device name of your SD card, and 14 with the sequence number of the last partition on your SD card.<br />
 
<br />
 
If Android is installed on eMMC, you can start a Linux system (such as Ubuntu or Debian) from an SD card and perform the same operation on the eMMC device via the command line. The device name for eMMC is usually /dev/mmcblk2.<br />
 
<br />
 
If the Android system has already been booted and you need to restore the factory settings after expanding the partition, for example, if the system is an Android tablet, the option to restore factory settings can be found here:<br />
 
Settings -> System -> Reset options -> Erase all data(factory reset)<br />
 
<br />
 
Using EFlasher to burn the Android image to eMMC will automatically expand the file system.<br />
 
===Android下的有线网络===
 
* 任何一个网口都能通过DHCP连接网络
 
* 如果想要配置静态IP,则只有 eth0 接口支持
 
* 某些应用可能有兼容性问题,会报没有网络连接的错误,但实际上网络是通的
 

Latest revision as of 08:25, 16 May 2024

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