1

This is my problem: I have an application that requires a certain persmission (Write-SMS) that will of course only function on phones. Now, the app requires that permission for a feature that will be disabled on tablet versions but it won't let users install the app on tablets.

I guess my question is this:

  1. Can I easily create a second manifest for the tablet version, that will be roughly the same as the phone version but without the persmission?

  2. If I'm doing so, is there a way to check what manifest version is being used? I might want to add features to the tablet version that are tablet exclusive and vice versa.

All of course preferibly in one apk, that gets exported and signed once. Thanks for your help in advance!

4

2 回答 2

3

简单添加:

<uses-feature android:name="android.hardware.telephony" android:required="false" />

到你的清单。SMS 权限会自动要求电话功能。添加这个告诉android,即使你要求这个功能,你也不需要它。

请务必添加 if-else 检查,以查看您是否可以在执行此操作之前从设备感应短信。

于 2013-06-13T15:34:37.607 回答
0

我认为您必须在实际方法本身中检查它,因为权限可以是可选的或强制的,但仅此而已,对于不同的设备无法区分..

于 2013-06-13T15:36:33.813 回答