Xiaomi Mi Box S 4K (AndroidTV 9) with Kodi and Netflix

The Xiaomi Mi Box S 4K is an inexpensive Android TV box. It's hardware is not as powerful as the Mecool KM9 Pro Deluxe with a similar price tag, but what sets it apart is that the Mi Box S is a Netflix approved device, which allows to stream Netflix in full HD or 4K. This Box is excellent, runs fast and stable, and features a Bluetooth Voice enabled Remote. It cannot be controlled with an IR remote and it does not have an Ethernet port. Read Harmony Remote and Network Access how to deal with these limitations. Read Mecool KM9 Pro (AndroidTV 9) with Kodi and Netflix for installation and setup instructions of the Meecool box.

Hardware

  • Xiaomi Mi Box S (aka Box) with 2GB RAM and 8GB NAND flash memory (of which only 5.5GB is usable for apps). For an operational Netflix app this is the only choice besides the expensive nVidia Shield.
  • Logitech Harmony Companion (aka Harmony) which controls TV, Amp, and media player.
  • Logitech K400+ Keyboard (aka Keyboard) which allows comfortable text imput.
  • USB 2.0 hub with Ethernet from UGREEN for the Xiaomi Mi Box S, which allows stable 100 Mbps up- and download speed.

Setup

  • Set When to start (30 minutes: time until screensaver gets activated), Screen saver (Backdrop), and Put device to sleep (12 hours) in Settings → Device Preferences → Screen saver
  • Set Language to English (United States) or German (Switzerland) in Settings → Device Preferences → Language
  • Sign in to your Google account in Settings → Accounts & Sign In
  • Update to the latest Android 9 build. If the box is shipped with Android 8.1, do the system update to Android 9. Do not update to Android 10+ if you can avoid it.
  • Set date and time in Settings → Device Preferences → Date & time
  • Disable notifications in Settings → Apps → View Phone Media
  • Enable Developer Mode by hitting 8 times on Settings → Device Preferences → About → Build
  • Map keys as explained in Button Mapper Setup

Pre-installed Google Play Apps

  • Android TV Remote Service
  • Camera –> unused
  • Gallery –> unused
  • Google Play Store
  • Google Play Games
  • Google Play Movies & TV
  • Google Play Music
  • Live Channelsunused
  • Netflix
  • Prime Videounused
  • YouTube for TV
  • YouTube Musicunused

Disable unused Apps

  • Above apps belong to the Xiaomi Mi Box S Android build and cannot be uninstalled.
  • Go to the home screen and disable the respective channels.
  • Go to settings → Apps, then Force stop, Clear data, and Disable them.
  • If your setup should contains any other apps not in the list below, uninstall those.

Sideloaded Apps

  • Go to Android TV App Launcher Builder and create an APK file for the Android TV Launcher and Home Screen. Should the url not be available anymore visit my guide on how to create an Android App with Android Studio. This allows to pin a small Android TV app to the Home Screen, which when started will start the app made for phone/tablet and exit.

Install from Google Play Store

Swiss Play Store

  • Zattoo TV, must be installed from Swiss app store over VPN (geoblocked) or when located in Switzerland
  • Download the latest version of the apk file from APKMirror to avoid changing twice the app store
  • Run the Zattoo app over VPN (geoblocked) or when located in Switzerland

Install from apk file

Optional install from apk file

These apps are listed for reference and not needed for a regular TV Box install.

ATV Launcher Pro Setup

  1. Align apps on the second level home screen.
  2. Change to 7 rows to align size of banners.
  3. Create folder System and move all apps which should only be used by the system admin into it. Color: 25, 255, 255, 255.
  4. Create folder TV and move all TV apps into it. Color: 0, 0, 100, 255.
  5. Create folder Media and move all media apps and Kodi into it. Color: 210, 160, 140, 255.
  6. Create folder Games and move all game apps into it. Color: 40, 255, 255, 255.
  7. Create folder Unused and move unused apps into it. Color: 0, 215, 200, 255.

Button Mapper Setup

To improve usability and user experience of the system remap some of the keys of the Logitech Harmony Remote and the Logitech Keyboard. Note that the Mi Box S bluetooth remote is compatible with the NVIDIA Shield remote, which we will use when setting up the Harmony Remote.

  1. Enable USB debugging in Settings –> Device Preferences –> Developer options and select Revoke USB debugging authorizations
  2. Open Button Mapper App on your device and select + Add Buttons. Press any button, for example the keyboard “F10” key we will remap later, and select the added key with the remote. Now select Customize and try to assign an Action or an Advanced command. Button Mapper will now take you through downloading a setup program for Windows or Mac. This setup program also includes adb.exe, which can be used to enable the necessary permissions on the device.
  3. You can enable the permissions with a USB connection:
    1. connect the Box with a USB-A to USB-A cable to your computer
    2. confirm the connection to the computer on the device
    3. run “ButtonMapperSetup.exe” on your computer and check the textbox to make sure the device is connected
    4. click “Grant WRITE_SECURE_SETTINGS permission” and Exit
  4. If the USB connection does not work, or if the box is not near your computer, run the commands manually:
    1. make sure the Box is connected to the same network as your computer. If you are connecting to a box where the ethernet connection is established through a USB to Ethernet hub (like the Xiaomi Mi Box) make sure to connect through wifi, as the bridge will not work once you enable USB debugging to connect with adb.
    2. open a shell (Command Prompt) on your computer and change to the folder “tools” inside the “ButtonMapperSetup” install folder
    3. enter the following commands within the shell
      adb connect <IP address>
      adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
      adb disconnect
      exit
    4. you might need to confirm the connection to the computer on the device after the adb connect command
    5. you might get an error message “error: more than one device/emulator” if an Android emulator such as BlueStacks is installed on your computer
    6. either terminate the emulator (or other device), or issue the following commands to list the devices connected and find and specify the model number in the shell command
      adb connect <IP address>
      adb devices -l
      adb -s model:MIBOX4 shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
      adb disconnect
      exit
    7. remember to connect to the Mi Box S through wireless, as the USB hub with Ethernet cannot be used when “Developper Options” are activ
    8. you might need to reboot the box when reconnecting a USB to Ethernet hub
  5. Disable USB debugging in Settings –> Device Preferences –> Developer options
  6. The Box does not need to be rooted, but you will need the Pro version of the app which costs $2 in the app store.
  7. Firefox TV is supported on Fire TV only, but runs without problems on Android TV 9. It requires a “menu” key to pin websites (bookmarks), which is not available on the Box Remote or the Keyboard. Map the “menu” key (keycode: 82) to the NVIDIA Shield's “mute” button (see Harmony Remote below), and to the Keyboard's “F10” key. This allows to invoke “menu” through the Harmony Remote's “menu” button, and through the Keyboard's “F10” key.
  8. The “menu” key is now also available in other apps such as Kodi and is equivalent to a long press of the OK button on the Box Remote and the Harmony Remote (long press of the OK button is not recognized in the Firefox TV app).
  9. Map the “screenshot” action to the double pressed “F10” key for the Keyboard, which allows to take a screenshot when pressing F10 twice. Helpful for creating a user manual for your family members.
  10. Map the “power-dialog” action to the long pressed NVIDIA Shield's “record” button, which allows to invoke the power dialog for rebooting the shield device.

Firefox for TV Setup

Firefox for TV is available in the US app store for Amazon Fire TV and Fire TV stick. Since the Fire TV OS is based on Android the app will run on any Android platform, but needs a few keyboard tweaks for proper operation, which are explained in the previous section Button Mapper Setup. In addition I recommend to change the Android TV tile icon and the pinned web sites to your liking.

  1. Install APK Editor Studio or Android Studio. APK Editor Studio is easier to use but more limited than Android Studio, it's sufficient to implement the suggested changes for Firefox TV.
  2. With APK Editor Studio, open the Firefox TV apk.
  3. Click “Application Icon” and replace the built-in icon with a nicer one for Android TV (Firefox TV).
  4. Click “Open Contents”, then find folder “assets\bundled\”. File “bundled_tiles.json” contains the url definitions, which you can freely modify. Besides my favorite urls I use a “bookmark” url which I can later modify without changing the json file, for example:
    [
        {
            "id": "bookmarks",
            "url": "https://www.condrau.com/bookmarks.html",
            "title": "Bookmarks",
            "img": "tile_bookmarks.png"
        },
        {
            "id": "bco",
            "url": "https://www.condrau.com/",
            "title": "Bernard Condrau",
            "img": "tile_bco.png"
        }
    ]
  5. Place matching png files with resolution 388x216px in the same folder as the json file, which Firefox TV will pick up to display the tiles.
  6. Click “Save APK” in APK Editor Studio to create your apk with customized pinned tiles.
  7. If you have Firefox TV already installed, uninstall it. APK Editor Studio creates a file with a different signature, which cannot be installed as long as an app with the same name is already installed. Put the new apk on a USB stick and install it with “FX File Explorer”.

Games

  • To install games you will USB stick to extend the limited device memory of the Xiaomi Mi Box S. Select one with USB 3.0 or 3.1 specification and decent transfer speed, which will allow faster memory read/write speeds even though the Xiaomi has only USB 2.0 built in. Move the games to the extended device memory, but no other apps, doing so allows you to disconnect the USB stick when you don't need it for game play.

Harmony Remote

  1. Before assigning keys to the remote we need to pair the Harmony Remote with the Mi Box S, as the Mi Box S can only be controlled via Bluetooth:
    1. Install the Harmony app to your phone or tablet from the app store
    2. Connect the app to your Harmony Hub and add “NVIDIA Shield” as a new device.
    3. Put the Mi Box S into pairing mode.
    4. Create a new activity for the Harmony Remote, at the end of which the remote should get paired with the Mi Box S. The Harmony Remote shows up as “keyboard” on the Mi Box S.
    5. If the pairing does not work, or if you need to re-pair (after changing the remote or after a reset of the box), then you need to delete the “NVIDIA Shield” device and all related activities from your Harmony Remote settings. After that, power cycle the remote and the box, then start over from a.
  2. The Shield remote has additional keys which are understood by the Mi Box S, so we can use those to get Playback and Navigation functionality properly set up.
  3. Open MyHarmony on your PC, then edit the button assignments for the SHIELD TV activity. Assign keys to the Harmony Remote which correspond to Kodi functions according to below's table.
  4. In Kodi, use Keymap Editor to map keys to Kodi functions which are not recoginzed automatically. Run Keymap Editor in Program Addons, then go to Edit → Global and chose the Action Category. Assign the keys, then Save them.
  5. A GamePad has a “Home” button, the equivalent for OK is the “A” button, the equivalent for Return is the “B” button. Other buttons would need to be mapped, but it is actually better to then use the remote for navigation.

Xiaomi Remote

Shield Remote

Harmony Remote

Kodi Function
Keymap Editor
Action Category
Home Home Exit - -
OK OK OK Select -
OK (long press) Mute Menu
Info
Menu -
Back Back Return Return -
Play Play Play -
Pause Pause Pause -
Stop Stop Stop -
Skip Backward Skip Backward Previous -
Rewind Fast Backward Rewind -
Skip Forward Skip Forward Next -
Fast Forward Fast Forward Fast Forward -
8 Ch Page Up Navigation
9 Pg Page Down Navigation
LG 3D TV Remote Harmony Remote
3D Red
DirectionLeft Green
DirectionRight Yellow
OK Blue

Network Access

The Xiaomi Mi Box S does not have an Ethernet port, which I prefer to be able to access my internal LAN without exposure to WIFI. Android on the Mi Box S will recognize a USB to Ethernet converter, I use a USB hub with Ethernet from UGREEN, USB 2.0 is sufficient. This not only adds the network port, but also 3 USB connectors so you don't need to unplug the adapter when plugging in a USB stick. Disable WIFI on the Mi Box S.

Links