1

I currently have an application, which is just a standard android app, but I wanted to add some google maps functionality to it.

So I created another project to get to grips with google maps API and to try and develop it to the point where it is doing exactly what i need it to do.

My issue is that i need my first app to be able to call or run the map application to retrieve data.

Is it possible to create a library from the map application and then import that into my first project? If so, how would i deal with calling it?

If not, how could I implement it into the application?

For what its worth, I would be calling it from a button in the menu.

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
Adam Faldo
  • 13
  • 3

2 Answers2

0

If you're using eclipse, you can right click your maps project, go to properties->android and check the box at the bottom of the screen that says "Is Library". Then in your other project, you need to import this library project in the same spot in properties. Instead of checking the box here, you would click "Add" and add the library project to your main.

In your manifest for your library project, you may need to adjust your intent filter to get rid of its Launcher functionality.

ootinii
  • 1,795
  • 20
  • 15
  • Thanks for the quick reply! :) I have done what you said and it is coming up with a new error Package real.Package requires unavailable shared library maps.Package.MapsStuff; failing! Why would it be labelled as unavailable? – Adam Faldo Apr 18 '12 at 14:20
0

If you want to make it into one app, you can copy the source and layout from the maps app into the main app, turn it into a separate Activity. Then use Intent to start the map activity, maybe pass some parameters and get result back to the main activity.

If you're using eclipse here's how to add activity

And a little tutorial for using Intent

Community
  • 1
  • 1
Steve Zhan
  • 553
  • 6
  • 9
  • Thanks for the reply. I will try doing this too. I have a preferences activity in the first one and have used intents to do that one. I'm assuming getting the maps activity to play ball will be the same. – Adam Faldo Apr 18 '12 at 14:43