我目前在我的 AndroidManifest.xml 中有这个
使用库 android:name="com.google.android.maps" android:required = "false"
google 地图 api 的指定要求不是强制性的。 (这使我能够在 none-google-api 模拟器上安装我的应用程序)
但是,这仅适用于 API 级别 7、平台 2.1它不适用于 API 级别 4、平台 1.6
我在编译时收到一条错误消息 - ”在包“android”中找不到属性“required”的资源标识符
但是,当我查看这里的文档时:http://developer.android.com/guide/topics/manifest/uses-feature-element.html http://developer.android.com/guide/topics/manifest/uses-feature-element.html
'required' 属性是从第 4 级开始引入的。
有人可以帮我吗!
谢谢艾林
我认为不可能在 use-library 标签中包含必需的属性。
有没有办法在java代码中而不是在AndroidManifest.xml中包含uses-library?
看起来 Android 文档已更新:
属性:
android:required
Boolean value that indicates whether the application requires the library specified by android:name:
"true": The application does not function without this library. The system will not allow the application on a device that does not have the library.
"false": The application can use the library if present, but is designed to function without it if necessary. The system will allow the application to be installed, even if the library is not present. If you use "false", you are responsible for checking at runtime that the library is available.
To check for a library, you can use reflection to determine if a particular class is available.
The default is "true".
Introduced in: API Level 7.
http://developer.android.com/guide/topics/manifest/uses-library-element.html http://developer.android.com/guide/topics/manifest/uses-library-element.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)