Skip to content

Run on Android 9 (API 28) - #2

Closed
dicklamman wants to merge 1 commit into
maxhayim:mainfrom
dicklamman:feature/android9-port
Closed

dicklamman wants to merge 1 commit into
maxhayim:mainfrom
dicklamman:feature/android9-port

Conversation

@dicklamman

Copy link
Copy Markdown
Contributor

What

Ports the webmote remote app to Android 9 (API 28), so it can be installed and used on an Android 9 TV.

Why

The upstream release APK requires Android 11 (minSdk 30) and the release asks for API 33, so on an Android 9 TV it cannot be installed at all.

How

  • minSdk 30 -> 28.
  • Map.of (API 30) replaced with a HashMap, for the Netflix search link.
  • ACTION_IME_ENTER (API 30) has no equivalent on Android 9: Enter is now sent by clicking the search or send button beside the focused text field.
  • Volume: this ROM routes volume through a vendor service, so the standard adjustStreamVolume either throws "Bad direction" or goes through without changing the level. Each way of asking is tried in turn and the next one is used when the level did not actually move: adjustStreamVolume, then the suggested-stream call the ROM's own volume panel uses, then a volume media key, then setting the level outright.
  • Lint and R8 are off: their dependency resolution fails on Windows in long build trees (MAX_PATH). The app has no libraries to shrink.

Tested on

Wanbo T6 Max, Android 9 (API 28), firmware 20220419. Pairing, the apps list, home, back, recents, the D-pad, OK, volume, mute, play/pause and launching apps were all verified against the real device.

The upstream app needs Android 11 (minSdk 30); the release APK asks for API 33,
so it cannot be installed on an Android 9 TV at all. This ports it to Android 9:

- minSdk 30 -> 28.
- Map.of (API 30) replaced with a HashMap, for the Netflix search link.
- ACTION_IME_ENTER (API 30) has no equivalent on Android 9: Enter is now sent
  by clicking the search or send button beside the focused text field.
- Volume: this ROM routes volume through a vendor service, so the standard
  adjustStreamVolume either throws "Bad direction" or goes through without
  changing the level. Each way of asking is tried in turn and the next one is
  used when the level did not actually move: adjustStreamVolume, then the
  suggested-stream call the ROM's own volume panel uses, then a volume media
  key, then setting the level outright.
- Lint and R8 are off: their dependency resolution fails on Windows in long
  build trees (MAX_PATH). The app has no libraries to shrink.

Verified on the Wanbo T6 Max (Android 9): pairing, the apps list, home, back,
recents, the D-pad, OK, volume, mute, play/pause and launching apps.
@dicklamman dicklamman closed this Oct 31, 2026
@maxhayim maxhayim self-assigned this Oct 31, 2026
maxhayim added a commit that referenced this pull request Oct 31, 2026
From #2 by @dicklamman, who ported Webmote to a Wanbo T6 Max projector
(Android 9):

- minSdk 30 -> 28; Map.of, which needs Android 11, is gone.
- Enter on Android 9 and 10 clicks the app's search, send or go button, since
  ACTION_IME_ENTER needs Android 11 (it was gated at 13 in the PR).
- Volume on Android 9 and 10 tries each way of changing it until the level
  moves, for ROMs that route volume through their own service. Android 11
  and newer keep the single call, so a TV handing volume to a sound bar
  doesn't get each press twice. setStreamVolume is called directly.

Lint and R8 stay on: turning them off only worked around a Windows path limit.
Version 0.2.0.

Co-authored-by: dicklamman <174199902+dicklamman@users.noreply.github.com>
@maxhayim

Copy link
Copy Markdown
Owner

Thank you @dicklamman! Android 9 support is in v0.2.0 (f0d8ed7), with you as co-author, and your Wanbo T6 Max is listed under Tested On in the README.

I changed a few things on the way in:

  • ACTION_IME_ENTER is Android 11 (API 30), not 13, so 11 and 12 keep the real Enter action. The search-button click is now for 9 and 10 only, and it matches content descriptions as well as text.
  • The volume fallbacks only run on Android 9 and 10. On newer TVs that hand volume to a sound bar over HDMI-CEC, the level here never moves, so the fallbacks would have sent each press twice.
  • setStreamVolume(stream, index, flags) is still in the SDK, so it's called directly instead of through reflection.
  • Lint and R8 stay on, since the Windows path limit doesn't affect this repo's builds. Lint passes at minSdk 28.

If you can, please try the v0.2.0 APK on the projector, especially volume and Enter in a search box, and open an issue if anything misbehaves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants