今天继续分享android的compatibility问题,原话题叫“Controlling Your App's Availability to Devices”。
开发者都希望一个apk能在千差万别的android手机上自由运行,android手机的千差万别,表现在android手机厂商的硬件支持、sdk的不同、屏幕尺寸等。如何在这些手机上运行得更加完美,Google提出了一些方案,官方内容如下:
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.
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:
- Device features
- Platform version
- Screen configuration
- Device features
接下来的四节,我们讲这四种方案。
本文探讨了如何确保Android应用程序能在各种不同配置的设备上良好运行。文章提供了通过平台API利用多种特性来控制应用可用性的策略,并介绍了如何通过禁用可选特性或提供替代资源来适应不同的设备配置。
422

被折叠的 条评论
为什么被折叠?



