是否可以使用谷歌API maps.jar在一个控制台应用程序? [英] Is it possible to use the Google API maps.jar in a console app?

查看:101
本文介绍了是否可以使用谷歌API maps.jar在一个控制台应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写的测试工具为我的Andr​​oid地图应用程序的一部分。

我想运行测试像Eclipse下的Java控制台应用程序。我需要的只是谷歌地图类是一个GeoPoint对象。我已经包括在构建路径的maps.jar和进口com.google.android.maps.GeoPoint所以它编译OK,但产生的运行时错误:

这一类文件的JAR属于容器谷歌的API [Android2.1的 - UPDATE1]'不允许其条目修改源代码的附件。

是否有可能在一个控制台应用程序使用这个jar,如果又如何?


解决方案

  

是否有可能在一个控制台应用程序使用这个jar,如果又如何?


没有,对不起。我甚至不觉得满级是该JAR - 这和的android.jar 只是存根AFAIK。真正的实现是设备或模拟器上。

您可以创建一个围绕的GeoPoint一个包装和使用本地执行您的测试。

I'm trying to write test harness for part of my Android mapping application.

I would like to run the test as a Java console app under Eclipse. The only Google maps class that I require is a GeoPoint. I've included the maps.jar in the build path and imported the com.google.android.maps.GeoPoint so it compiles OK but generates a runtime error of :

"The JAR of this class file belongs to container 'Google APIs[Android2.1 - update1]' which does not allow modifications to source attachments on its entries".

Is it possible to use this jar in a console app, and if so how?

解决方案

Is it possible to use this jar in a console app, and if so how?

No, sorry. I don't even think the full class is in that JAR -- that and android.jar are just stubs AFAIK. The real implementation is on the device or emulator.

You could create a wrapper around GeoPoint and use a local implementation for your testing.

这篇关于是否可以使用谷歌API maps.jar在一个控制台应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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