首页 文章 精选 留言 我的

精选列表

搜索[浏览器兼容性],共10009篇文章
优秀的个人博客,低调大师

Android设备兼容性 2

版权声明:本文为sydMobile原创文章,转载请务必注明出处! https://blog.csdn.net/sydMobile/article/details/78144278 文章最早发布于我的微信公众号中,欢迎大家扫描下面二维码关注微信公众获取更多干货资源。 本文为sydMobile原创文章,可以随意转载,但请务必注明出处! 翻译自Android官方文档加入了自己的理解! Controlling Your App’s Availability to Devices 控制你的程序的可用性在不同的设备上 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. Android支持许多的功能,你的APP可以通过API充分的利用这些功能。一些功能是硬件作为支持(比如指南针传感器),一些是软件作为支持(比如APP小空间),还有一些依赖于平台的版本(也就是Android平台的版本)不是每个设备都支持Android的所以功能。所以你需要根据你的app所需要的特点来控制你的APP的实现。 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: 为了让你的APP实现最大的用户量,你应该努力的去支持大量的设备通过用一个APK,在大多数情况下,你可以舍弃一些不必要的功能提供一些在不同设备上必须的资源(比如为不同的屏幕尺寸添加不同的布局文件,这就是屏幕适配的一种方式)如果有必要的话,你也可以通过Google Play来限制一些不可以使用的设备。 Device features 设备特点 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. 为了让您根据设备功能来管理应用的可用性,Android定义了所有设备可能无法使用的任何硬件或软件功能的功能ID。 例如,罗盘传感器的功能ID为FEATURE_SENSOR_COMPASS,应用程序小部件的功能ID为FEATURE_APP_WIDGETS。 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. 如果需要,您可以通过在应用程序的清单文件中使用元素声明该设备,从而避免用户安装应用程序。 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: <manifest ... > <uses-feature android:name="android.hardware.sensor.compass" android:required="true" /> ... </manifest> 例如,如果您的应用在缺少罗盘传感器的设备上无效,则可以根据需要使用以下清单标签声明罗盘传感器: 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. 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: PackageManager pm = getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS)) { // This device does not have a compass, turn off the compass feature disableCompassFeature(); } 然而,如果您的应用程序的主要功能不需要设备功能,则应将所需属性设置为“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”,使您的应用程序可用于无蓝牙设备。 有关隐式需要的设备功能的更多信息,请阅读具有要求功能要求的权限。 未完待续…. 扫一扫关注微信公众号,获取更多干货和资源。

优秀的个人博客,低调大师

Android的兼容性问题剖析

1.PC是X86构架,主要生产厂是Inter和AMD,android智能手机基本上都是ARM构架,主要生产厂家有高通、三星、NVIDIA等,也不是很多,所以架构方面应该不是导致碎片化的主要原因才是啊?或许我理解的问题? 架构方面是一个重要原因。 x86架构从当年8086开始,到如今的x64的64位平台,能做到汇编指令完全兼容。 再看看ARM架构有多混乱: ARM处理器内核列表 x86架构的字节序是固定的,而ARM架构的字节序都是可变的,字节序就是大小端的意思,比如一个32位的数据:0x12345678,在x86架构下,内存里永远都是0x78 0x56 0x34 0x12,而在ARM架构里,可能是前者,也可能是0x12 0x34 0x56 0x78. 字节序本身没有什么优劣之分,但对于开发人员来说,可变的字节序意味着移植机器代码是有困难的。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册