代号为安卓电视的APK清单:构建提示 [英] Codename One APK Manifest for Android TV: build hints

查看:10
本文介绍了代号为安卓电视的APK清单:构建提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与:Codename One APK Manifest for Android TV

我在这里找到了一些文档:https://developer.android.com/training/tv/start/start

在本文档中,If you do not include the CATEGORY_LEANBACK_LAUNCHER intent filter in your app, it is not visible to users running Google Play on TV devices.

我尝试使用以下两个构建提示(包含源代码):

android.xpermissions=<uses-feature android:name="android.software.leanback" android:required="false" /><uses-feature android:name="android.hardware.touchscreen" android:required="false" />

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

这是我生成的AndroidManifest.xml,可能有一些问题:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="net.informaticalibera.apps.unialeph"
      android:versionCode="100"
      android:versionName="1.0"
      xmlns:tools="http://schemas.android.com/tools"
      android:minSdkVersion="15"
      android:installLocation="auto">
    <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="27"  />
    <supports-screens android:smallScreens="true"
          android:normalScreens="true"
          android:largeScreens="true"
          android:xlargeScreens="true"
          android:anyDensity="true" />
  <application  android:label="UniAleph"  android:icon="@drawable/icon"  android:allowBackup="true" >
<provider
          android:name="android.support.v4.content.FileProvider"
          android:authorities="${applicationId}.provider"
          android:exported="false"
          android:grantUriPermissions="true">
          <meta-data
              android:name="android.support.FILE_PROVIDER_PATHS"
              android:resource="@xml/file_paths">
          </meta-data>
      </provider><meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>        <activity android:name="UniAlephStub"
                  android:theme="@style/CustomTheme"
                  android:configChanges="orientation|keyboardHidden|screenSize"
                  android:launchMode="singleTop"
                  android:label="UniAleph">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  <intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LEANBACK_LAUNCHER" /></intent-filter><receiver android:name="com.codename1.impl.android.LocalNotificationPublisher" ></receiver>
<service android:name="com.codename1.impl.android.BackgroundFetchHandler" android:exported="false" />
<activity android:name="com.codename1.impl.android.CodenameOneBackgroundFetchActivity" android:theme="@android:style/Theme.NoDisplay" />
<activity android:name="com.codename1.location.CodenameOneBackgroundLocationActivity" android:theme="@android:style/Theme.NoDisplay" />
<service android:name="com.codename1.location.BackgroundLocationHandler" android:exported="false" />
<service android:name="com.codename1.location.GeofenceHandler" android:exported="false" />
<service android:name="com.codename1.media.AudioService" android:exported="false" />    </application>
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    <uses-permission android:name="android.permission.INTERNET" android:required="false" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="false" />
  <uses-feature android:name="android.software.leanback" android:required="false" /><uses-feature android:name="android.hardware.touchscreen" android:required="false" /></manifest>
我注意到: <intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LEANBACK_LAUNCHER" /></intent-filter>应该在<activity>标记中:如果我错了,请纠正我。我认为活动应该是相同的,因为只有一个活动。请注意https://developer.android.com/training/tv/start/start中的示例:

<application
  android:banner="@drawable/banner" >
  ...
  <activity
    android:name="com.example.android.MainActivity"
    android:label="@string/app_name" >

    <intent-filter>
      <action android:name="android.intent.action.MAIN" />
      <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

  <activity
    android:name="com.example.android.TvActivity"
    android:label="@string/app_name"
    android:theme="@style/Theme.Leanback">

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

  </activity>
</application>

第二个问题是<uses-feature android:name="android.hardware.touchscreen" android:required="false" />重复两次:它是默认的吗,所以我不必指定它?

我当然不是androidManifest.xml专家,此问题是在再次提交应用以供审阅之前询问您对这些构建提示和生成的清单的意见。

推荐答案

默认情况下,您不需要指定触摸屏。

android.xapplication用于添加其他活动。我认为您应该为此使用android.xintent_filter,而不是android.xapplication

这篇关于代号为安卓电视的APK清单:构建提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆