访问在新的英特尔的x86 Android模拟器谷歌的API [英] accessing google apis in the new intel x86 android emulator

查看:128
本文介绍了访问在新的英特尔的x86 Android模拟器谷歌的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是试图在新的​​x86 Android模拟器上运行我公司的应用程序,但我们的应用程序依赖于谷歌地图API,这是不具备的,谷歌提供了Android SDK版本17.我的直觉说的x86系统映像答案是否定的,但有可能获得谷歌的API进入这个系统映像不知何故?如果没有,有没有什么办法可以有条件地不使用像谷歌地图的系统API,如果它是不是你正在使用的设备/仿真器present?

解决方案
  

我的直觉说,答案是否定的,但有可能获得谷歌的API进入这个系统映像不知何故?

有,但一个图像,因此如果地图不存在,那么地图是不存在的。您不能添加的地图附加到现有的仿真图像,除非是通过软件的盗版,因为在这个问题上主张对方的回答。

  

如果没有,有没有什么办法可以有条件地不使用像谷歌地图的系统API,如果它是不是你正在使用的设备/仿真器present?

当然可以!

步骤#1:添加机器人:要求=假<使用库> 元素谷歌地图,这样你就可以安装应用程序

步骤#2:有时候你开始尝试使用谷歌地图,看看你是否有使用地图相关的类前的Class.forName()

例如,在本书示例项目,我发射活动看,如果我们有 MapActivity ,如果我们这样做,这将控制传递给 MapActivity 实例,如果没有显示出吐司

I just tried to run my company's app in the new x86 android emulator, but our app relies on the google maps API, and that is not available in the x86 system image that google provided with android sdk release 17. My intuition says the answer is no, but is it possible to get the google apis into this system image somehow? If not, is there any way to conditionally not use a system API like google maps if it isn't present on the device/emulator that you are currently using?

解决方案

My intuition says the answer is no, but is it possible to get the google apis into this system image somehow?

There is but the one image, so if Maps are not there, then Maps are not there. You cannot add the Maps add-on to an existing emulator image, except perhaps via software piracy, as the other answer on this question advocates.

If not, is there any way to conditionally not use a system API like google maps if it isn't present on the device/emulator that you are currently using?

Absolutely!

Step #1: Add android:required="false" to your <uses-library> element for Google Maps, so you can install the app

Step #2: Sometime before you start trying to use Google Maps, see if you have Maps-related classes using Class.forName()

For example, in this book sample project, my launcher activity sees if we have MapActivity, and if we do, it passes control to a MapActivity instance, and if not shows a Toast.

这篇关于访问在新的英特尔的x86 Android模拟器谷歌的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆