Android设备兼容性 2

  • 时间:
  • 浏览:2
  • 来源:彩神欢乐生肖_神彩欢乐生肖官方

未完待续….



扫一扫关注微信公众号,获取更多干货和资源。

Google Play商店将您的应用所需的功能与每个用户设备上的功能进行比较,以选取您的应用是与非 与每个设备兼容。 机会设备这样提供您的应用所需的所有功能,则用户无法安装您的应用。

In order for you to manage your app’s availability based on device features, Android defines feature IDs for any hardware or software feature that may not be available on all devices. For instance, the feature ID for the compass sensor is FEATURE_SENSOR_COMPASS and the feature ID for app widgets is FEATURE_APP_WIDGETS.

To achieve the largest user-base possible for your app, you should strive to support as many device configurations as possible using a single APK. In most situations, you can do so by disabling optional features at runtime and providing app resources with alternatives for different configurations (such as different layouts for different screen sizes). If necessary, however, you can restrict your app’s availability to devices through Google Play Store based on the following device characteristics:

为了让您根据设备功能来管理应用的可用性,Android定义了所有设备机会无法使用的任何硬件或软件功能的功能ID。 之类,罗盘传感器的功能ID为FEATURE_SENSOR_COMPASS,应用系统程序小部件的功能ID为FEATURE_APP_WIDGETS。

Google Play Store compares the features your app requires to the features available on each user’s device to determine whether your app is compatible with each device. If the device does not provide all the features your app requires, the user cannot install your app.

If necessary, you can prevent users from installing your app when their devices don’t provide a given feature by declaring it with a element in your app’s manifest file.

为了愿意的APP实现最大的用户量,你应该努力的去支持小量的设备通过用一另另另一个多 APK,在大多数情況下,愿意舍弃一点需要的功能提供一点在不同设备上需要的资源(比如为不同的屏幕尺寸去掉 不同的布局文件,这好多好多 屏幕适配的两种 辦法 )机会有必要语句,你也需要通过Google Play来限制一点需要使用的设备。

However, if your app’s primary functionality does not require a device feature, you should set the required attribute to “false” and check for the device feature at runtime. If the app feature is not available on the current device, gracefully degrade the corresponding app feature. For example, you can query whether a feature is available by calling hasSystemFeature() like this:

For example, if your app does not make sense on a device that lacks a compass sensor, you can declare the compass sensor as required with the following manifest tag:

机会需要,您需要通过在应用系统程序的清单文件中使用元素声明该设备,从而处置用户安装应用系统程序。

之类,机会您的应用在缺少罗盘传感器的设备上无效,则需要根据需要使用以下清单标签声明罗盘传感器:

Android支持一点的功能,你的APP需要通过API充分的利用有有哪些功能。一点功能是硬件作为支持(比如指南针传感器),一点是软件作为支持(比如APP小空间),还有一点依赖于平台的版本(也好多好多 Android平台的版本)都在每个设备都支持Android的好多好多 功能。好多好多 你需要根据你的app所需要的特点来控制你的APP的实现。

Android supports a variety of features your app can leverage through platform APIs. Some features are hardware-based (such as a compass sensor), some are software-based (such as app widgets), and some are dependent on the platform version. Not every device supports every feature, so you may need to control your app’s availability to devices based on your app’s required features.

然而,机会您的应用系统程序的主要功能需要设备功能,则应将所需属性设置为“false”,并在运行时检查设备功能。 机会应用功能在当前设备上不可用,则会适当地降低相应的应用功能。 之类,您需要通过调用hasSystemFeature()来查询功能是与非 可用: For information about all the filters you can use to control the availability of your app to users through Google Play Store, see the Filters on Google Play document. 有关所有过滤器的信息,需要通过Google Play商店来控制用户的应用系统程序的可用性,请参阅Google Play上的过滤器文档。 Note: Some system permissions implicitly require the availability of a device feature. For example, if your app requests permission to access to BLUETOOTH, this implicitly requires the FEATURE_BLUETOOTH device feature. You can disable filtering based on this feature and make your app available to devices without Bluetooth by setting the required attribute to “false” in the tag. For more information about implicitly required device features, read Permissions that Imply Feature Requirements. 注意:一点系统权限隐含地要求设备功能的可用性。 之类,机会您的应用系统程序请求访问BLUETOOTH的权限,则会隐式地需要FEATURE_BLUETOOTH设备功能。 您需要根据此功能禁用过滤,并通过在标签中将所需属性设置为“false”,使您的应用系统程序可用于无蓝牙设备。 有关隐式需要的设备功能的更多信息,请阅读具有要求功能要求的权限。

版权声明:本文为sydMobile原创文章,转载请务必注明出处! https://blog.csdn.net/sydMobile/article/details/78144278

文章最早发布于我的微信公众号中,欢迎大伙儿 扫描下面二维码关注微信公众获取更多干货资源。

本文为sydMobile原创文章,需要随意转载,但请务必注明出处!

翻译自Android官方文档加入了被委托人的理解!