[英]What version of Google APIs should I use when I target older Android devices?
I have an Android application that I designed for API 15 devices and upwards ie ICS. 我有一个为API 15设备及更高版本(即ICS)设计的Android应用程序。 Now I'd like to also target API 10 devices ie Gingerbread.
现在,我也想针对API 10设备,例如Gingerbread。 In order to do this I used ActionBarSherlock.
为了做到这一点,我使用了ActionBarSherlock。
Okay, so I followed the docs and got Sherlock. 好的,所以我遵循了文档,找到了夏洛克。 I updated my code.
我更新了我的代码。 I had one activity which was
MapActivity
and this needed to be replaced by the SherlockMapActivity
. 我有一个活动,即
MapActivity
,需要用SherlockMapActivity
代替。 Done. 做完了
In my project's build target, I specified the target as "Google APIs for API 15". 在项目的构建目标中,我将目标指定为“ API 15的Google API”。 In my application's manifest file, I've set the minimum SDK requirements to API 10. Now when I've created a Gingerbread emulator and try to launch my application, I get the following error:
在我的应用程序清单文件中,我已将SDK的最低要求设置为API10。现在,当我创建Gingerbread模拟器并尝试启动我的应用程序时,出现以下错误:
Package com.mridang.soemthing requires unavailable shared library com.google.android.maps;
包com.mridang.soemthing需要不可用的共享库com.google.android.maps; failing!
失败!
I understand that this is because Gingerbread is missing the "Google APIs for API 15" which is understandable but if I set the project's build target as "Google APIs for API 10" then I can't use the block of code that I have that uses the CalendarContract
which only came in the future APIs. 我了解这是因为Gingerbread缺少可以理解的“ API 15的Google API”,但是如果我将项目的构建目标设置为“ API 10的Google API”,那么我将无法使用具有该功能的代码块使用仅在将来的API中附带的
CalendarContract
。
It seems to be a Catch-22 situation and I can't seem to understand how to make my application work on both devices. 这似乎是Catch-22的情况,我似乎无法理解如何使我的应用程序在两种设备上都能工作。 Any help?
有什么帮助吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.