Difference between revisions of "Template:Android12"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
Line 17: Line 17:
 
===Bluetooch models supported by Android===
 
===Bluetooch models supported by Android===
 
====Bluetooth Adapters====
 
====Bluetooth Adapters====
 +
* RTL8822CE
 
* RTL8761B  (Test sample:UGREEN CM390 Bluetooth 5.0 USB Adapter)
 
* RTL8761B  (Test sample:UGREEN CM390 Bluetooth 5.0 USB Adapter)
 
* CSR8510 A10 Bluetooth Dongle 0a12:0001
 
* CSR8510 A10 Bluetooth Dongle 0a12:0001
Line 39: Line 40:
 
====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;
 
* Reboot
 
* Reboot
 
====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;
 
* Reboot
 
* Reboot
 
====Using ADB====
 
====Using ADB====
Line 58: Line 59:
 
nanopi3:/ $  
 
nanopi3:/ $  
 
</syntaxhighlight>
 
</syntaxhighlight>
===Expanding the Storage Partition===
+
===How to Change Default Launcher in Android TV===
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:
+
* 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">
 
<syntaxhighlight lang="bash">
echo "write" | sfdisk /dev/sdX -q --force
+
$ adb install com.oversea.aslauncher_1.0.9.0_5094.apk
parted -s /dev/sdX unit % resizepart 14 100 print
+
Performing Streamed Install
 +
Success
 
</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 />
+
* After the installation is complete, launch it, and then enter the following ADB command to obtain its package name:
<br />
+
<syntaxhighlight lang="bash">
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 />
+
$ adb shell dumpsys window | grep mCurrentFocus
<br />
+
mCurrentFocus=Window{7a950fb u0 com.oversea.aslauncher/com.oversea.aslauncher.ui.main.MainActivity}
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 />
+
</syntaxhighlight>
Settings -> System -> Reset options -> Erase all data(factory reset)<br />
+
* As you can see, the package name of Emotn UI is com.oversea.aslauncher, set it as the default launcher:
<br />
+
<syntaxhighlight lang="bash">
Using EFlasher to burn the Android image to eMMC will automatically expand the file system.<br />
+
$ 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===
 
===Wired networks on Android===
 
* Any network port can connect to the network via DHCP
 
* Any network port can connect to the network via DHCP
 
* If you want to configure a static IP, only eth0 interface is supported
 
* 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
 
* Some applications may have compatibility issues and report no network connection error, but the network is actually connected

Revision as of 05:33, 17 June 2023

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 (Test sample:UGREEN CM390 Bluetooth 5.0 USB Adapter)
  • CSR8510 A10 Bluetooth Dongle 0a12:0001

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;
  • Reboot

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;
  • Reboot

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.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