You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于Codename One生成Android TV APK清单的问题咨询

Correcting Codename One Android TV Manifest Configuration for Google Play

Let's break down your questions and fix the configuration issues step by step:

1. Placement of LEANBACK_LAUNCHER Intent Filter

You're absolutely right — the LEANBACK_LAUNCHER intent filter must be nested inside the UniAlephStub activity tag to be recognized properly by Android TV systems.

Your current android.xapplication build hint adds the intent filter directly under the root <application> tag, which is invalid. Instead, use the android.xactivity hint to target the main stub activity:

android.xactivity=<intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LEANBACK_LAUNCHER" /></intent-filter>

This ensures the filter is injected into the correct <activity> block for UniAlephStub, making your app visible on Google Play for TV devices.

2. Duplicate touchscreen Feature Declaration

You're also correct about this — Codename One automatically adds <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> by default to support non-touch devices like Android TV. Manually including it in your android.xpermissions hint causes the duplicate entry in the manifest.

You can safely remove that line from your permissions hint.

Here's the cleaned-up, correct set of build hints for Android TV compatibility:

android.xpermissions=<uses-feature android:name="android.software.leanback" android:required="false" />
android.xactivity=<intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LEANBACK_LAUNCHER" /></intent-filter>
  • The leanback feature is marked as optional so your app can still run on devices without the leanback library (like regular Android phones/tablets).
  • The LEANBACK_LAUNCHER filter is correctly attached to the main activity, satisfying Google Play's TV visibility requirements.

After generating the APK, double-check the AndroidManifest.xml to confirm:

  • The LEANBACK_LAUNCHER intent filter is inside the <activity android:name="com.codename1.impl.android.UniAlephStub"> tag
  • Only one instance of the touchscreen feature declaration exists (the default one added by Codename One)

内容的提问来源于stack exchange,提问作者Francesco Galgani

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 03:43:30