tags:

views:

31

answers:

1

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?

+1  A: 

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.

CommonsWare
Thank you. I thought as much. When I traced through in debug - the exception was just 'stub'. I'll create a fake GeoPoint for testing, which should be quicker to launch than going through the AVD each time
NickT