Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Google API to existing eclipse project

I am writing an android app that will use Google Maps but to implement this I need the Google API. When I downloaded the android platform sdk (example android 4.0) I did not download the Google API cause did not know that I would need it to implement this feature.However, I went back and downloaded it. How do I add it to my existing project. Did some searching and all showed how to start a new project with the API but not how to add it to the existing project.

like image 682
Mario Dennis Avatar asked May 07 '26 10:05

Mario Dennis


2 Answers

Since you have already downloaded the Google APIs for the version that you are developing for, example Android 4. all you have to do is:

Right click on your project -> Go to Properties -> Then Android - > Then select the Google APIs at API level 14

like image 187
Joel Dean Avatar answered May 10 '26 00:05

Joel Dean


Try this simple thing. In your file which you need the google maps api which extends 'Activity', replace Activity with MapActivity. It should have a red line showing error on your code. hover mouse over it and click on the option 'Fix Project Setup'. you will then find an option that suggests you to import Google APIs. select it, and you are done. Let me know if that works.

like image 20
noobcoder Avatar answered May 10 '26 00:05

noobcoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!