简体   繁体   English

当我定位较旧的Android设备时应该使用什么版本的Google API?

[英]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? 有什么帮助吗?

You cannot use CalendarContract on Android devices running less than API Level 14. 您不能在运行低于API级别14的Android设备上使用CalendarContract

you can get More Details HERE on Commonsware Blog Spot. 你可以得到更详细的位置上Commonsware博客现货。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该使用哪个版本的CXF? - What version of CXF should I use? 我应该为Android使用哪些端口? - What ports should I use for Android? 我应该为Android使用哪个PDF库? - What PDF library should I use for Android? 在这里,我应该为Android上下文使用什么? - What should I use for the Android context here? 不确定我应该在 android 中使用什么控件 - Not sure what control in android should I use Android:Android推送通知应该使用什么? Google Cloud Messaging或Parse.com - Android: what should I use for android push notification? Google Cloud Messaging or Parse.com 开发Android时,应该参考API编号或OS版本,有什么区别? - When developing Android, should I refer to API number or OS version and what is the difference? 我可以使用NotificationCompat.BigTextStyle而不会在较旧的设备上崩溃吗? - Can I use NotificationCompat.BigTextStyle without crashing on older devices? 我应该为哪个版本的Android编译以避免内部类警告 - What version of Android should I compile for to avoid inner class warning Glassfish 3.1和Java 7应该使用哪个版本的Jersey? - What version of Jersey should I use with Glassfish 3.1 and Java 7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM