Add Google API to existing eclipse project - java

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.

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

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.

Related

How to see whats inside android classes?

i have been using android studio for an year now and i know what some classes do but i am just keen to know whats inside those methods in the classes. if I go di that class by pressing Ctrl+click it takes me to class but can't see what is inside the class methods.and google code search has shut down last year.where do i find core android classes?
In the Android SDK Manager you can download sources. I'm not sure how you get to the SDK manager in Studio because I use Eclipse.
From here,
Just open the Android SDK Manager and select the Sources for Android SDK of the API level you are trying to support and click Install packages.
Here is a tutorial on how to find and use SDK manager.

Intellij: Getting Started with Google App Engine

I try to create a Google App Engine project in Intellij 2016.3 based on this tutorial. The described "Google App Engine" plugin does not exist. I used the "Google Cloud Tools" instead. I enabled it, downloaded the actual Cloud SDK and added it to the App Engine under "Build, Execution, Deployment".
When I try to create an App Engine project as described in the tutorial, I should add under "Additional Libraries and Frameworks" the Google App Engine but this selection is not available. The project created without it is a standard Java project with no relation to the App Engine.
What do I have to do to create a Google App Engine project in Intellij?
Ok, the answer is already in the comment from Dan Comilescu above. I found it independently after exchanging almost 10 emails with Jetbrains. They first told me that Google App Engine is included by default into Intellij. Therefore everything should just work as described. Only after checking the logs they became aware that the problem is that it is only included in the Ultimate edition of Intellij. The Community edition does not have it and therefore can not use it! I urged them to put that on top of their tutorial page and meanwhile they have added it.

Integrate endpoints.cmd generated library from maven eclipse plugin project into android app

I'm a bit of a newbie to all this.. but I can't seem to find any specific instructions for my scenario
I have built a simple endpoint api, using a maven project via eclipse.
I have built an android app, and just want to add a little test in it to use the simple api.
(sidenote: i have also built an app engine web app which will later also [i hope] make use of the same endpoint api, so both the web app and the android app make use of the same library / code)
anyway, I'm stumbling on a couple steps.
I can't seem to use the eclipse 'google -> generate cloud endpoint client library' option, since it's a maven project.
So i found on the google site, instructions to use the endpoints.cmd commandline to generate the library.
I successfully did this apparently (it created a zip file rather then just a jar)
here is where i am confused what to do next.. or if i missed something.
I have tried adding the jar within the zip as a library in the build path for my android app.
When I do that, I see that the Builder member doesn't seem to have been added.
Should I expect it to have been added by the library generation?
I can't seem to do anything in my android app code to use the library.
What am I missing / doing wrong?

Facebook SDK crashes google-play-services-lib if imported as existing Android source code

I have an extremely strange problem to which finding solution seems to be very tricky. Here's the story:
The application I'm working on uses both Facebook SDK and Google Maps v2. Team mate was working on Google Maps and I was working on Facebook part. When we combine his and mine code it appears that just having FacebookSDK as an imported project in the workspace (not even referenced in Properties|Android|Library section of our app) , straight away makes the app not see the Google Maps library. The work around is to add Google Maps into Java build path, however the application still crashes when we try to access the activity based on Google Maps. Not having Facebook SDK in the workspace makes the Google Maps work. When the app is ran with Google Maps added to the Java build Path, when trying to access the Google Maps activity LogCat shows NoClassDefFoundError exception.
Hope I explained the problem well. If not then let me know what more is required to get closer to fixing this strange problem. Thanks :)
SOLUTION: It seems that adding Java Build Path reference to android_sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google_play_services.jar file fixed the issue. Crysis averted. ;)

Libgdx and google IAP

As per #P.T. suggestion on this question, in order to link Google IAP (In-Apps Purchase) with Libgdx, where should I place the IInAppBillingService.aidl and all the other util files (TriviaDriveSample.util\files)? Should I place it in my main java project (assuming greatGame) or my android project (assuming greatGame-android)? I am currently facing issue integrating Libgdx and Google IAP.
Can some guru please lead me to the destination?
Both of them go into the Android project. For example this is my hierarchy:
MyGame-Android
..-src
....-com
......-android
........-vending
..........-billing
............*IInAppBillingService.aidl
......-my
........-package
..........-util
............*utilfiles...
..........*MainActivity.java
This is because to handle IAP you need to use android specific code in the android project, and interfacing it from the core. Go here for more info about it: https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code

Categories

Resources