How to import a new project in android app properly? - android

I am making an android app which uses google maps api v2. I want to use the clustering features so I am following the tutorial here
http://karnshah8890.blogspot.ca/2013/04/clustering-on-google-map-v2.html
and using the android maps extension plugin
http://code.google.com/p/android-maps-extensions/
The problem is how do I import this project in my app. I tried doing file > import, then browse for the folder called android-maps-extensions then right click my project folder then click properties then add the reference to the android-maps-extensions. Right after that, I get tons of errors in my project about needing to import R. If I try that, I get other errors.
Does anyone know how to fix this?
Thanks.

I had the same problem and I've found a solution:
right-click on android-maps-extensions
select "Android Tools / Add Support Library..."
right click on your project
in the Android section, remove the google-play-service library and keep only the android-maps-extensions
do a clean up, and it should work

try:
New->other->android->Android Project from Existing Code
point to the root dir(android-maps-extensions-1.3.1)
then select android-maps-extensions
[finish]
this is a library project
then you need to add this library to your project:
right click on your project->properties-Android-> scroll to the bottom to the Library section then hit add and select android-maps-extensions.

Related

Issue with support library setup as per android developer guide using Eclipse

I've been through all of the subjects and all over Internet to try solving this problem, but can't seem to find any solution.
Basically I've followed every step here Support Library Setup - Adding libraries with resources, but can't figure out the last one.
Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the Library pane, click Add.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.
Now the problem is in library pane I see multiple add options (Add JARs, Add External JARs, Add Variable, Add Library Add Class Folder and Add External Class Folder)
Can anyone give me a bit more detailed explanation what I actually need to add?
The only place I see only Add option is "Projects" pane.
Cheers,
DP
This is to add a library that u got to your android application. So you can publish your app with the library to use it.
Like Actionbar sherlock, angEngine, admob or any other library.
To let your application support it, you should add it to it's project first.
And best way is to choose Add External JARS, or anything you would like.
First import the library into your workspace (where your androi project is). Import the library to eclipse. It is found under /sdk/extras/android/support/v7/appcompact.
Right click on your android project. Goto properties. Choose android. Click Add browse and add reference the same in your android project
Click add browse and add the library project
When you add it looks like below
Do it the easy way : right click your project folder in the Package Explorer or Navigator, then look for Android Tools > Add Support Library. A dialog with open to ask you to accept the license. Accept, click Install, and you're good to go ;-)

adding library for google map api v2 in android

I cannot add google play service library project in my existing android app project to implement google map. Android dependencies are also not been added in the existing app project. It shows me error. I am always trying to add it from my saved sdk manager folder in my adt bundle but the library project is not added. Though I have imported the google_play_service_lib project in my package explorer. Please some body help me.
Thanks in advance.
RightClick On Project->property->Android->Add->select google play services lib ->Apply->ok
Go to: Your Drive:\android-sdk-windows\extras\google\google_play_services add it in your eclipse, if this will added if you have completed whole process of google map.
Make sure that your library and project in the same Workspace.
RightClick On Project->properties->Android->Add->select googleplayservices library->Apply->ok
Try Like this,
File>New>Project>Android>Android Project from Existing code>Browse: Navigate to adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\extras\google\google_play_services> Select libproject
Then you can add this Library project in your own project.
Hope this will help.
Import the android project library "google-play-services_lib" in your Eclipse workspace.
File > Import > Android > Existing Project in WorkSpace.
Select path to google play services library. Click Ok.
Go to your Project Settings (right click project).
then go to Android Tab in left.
Under library section click ADD to add the library project. Apply the settings.

Importing google-play-service library showing a red X next to this reference android

Am trying to add google-play-service library in my project using import(For Google map). After adding the path am getting red X next to this reference and the reference is not adding . Know how to resolve this ?
The red X means its a broken link path.
http://developer.android.com/google/play-services/setup.html
Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.
<android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .
Import the library project to your eclipse
Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.
Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply
Eclipse does weird things when importing an existing project (google-play-services-lib), especially if you try to import and then allow the project to be automatically 'copied' to your workspace. I had the same issue and here is how I fixed it:
Close Eclipse
Erase all google-play-services projects from your workspace
Manually copy the google-play-services-lib folder (....sdk\extras\google\google_play_services\libproject\google-play-services_lib) into your workspace
Open Eclipse
Add a new project, choosing 'Existing Android Project', then navigate to your workspace and add the newly copied google-play-services-lib project
Finally, add the google-play-services-lib to your project as a library (just like you normally would)
Hope this helps! :)
Though it's over a year for this question but never the less thought of putting it down here. Might help some one facing a similar issue.
While doing a File -> Import one probably might have selected the folder,
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\
instead of
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\libproject\google-play-services_lib
Quite strange as Eclipse did not correctly copy the google-play-services_lib project in my workspace, but this caused a cross mark to appear in my Project Properties.
got a perfect solution for your question. this problem is due to improper referencing of library projects. You need follow these step.
create a new project
copy all the java files from src of your previous project in which you are getting error to the new project you have created just now.
Also copy layouts xml files.
now import play services you will not get this error.
I was also getting same problem.
I copied google library folder into work space and import now it's working fine.
Try to place the Google-play-service library with in your same working Directory by coping the files from Click File > Import, select Android > Existing Android Code into Work space, and browse the work space import the library project.
This is common issue Youur google-play-service-lib project and your android project should be inside the same folder For example
if your Android Appplication name is MyMap is in D:/workspace t hen your play service lib project should be in the same directory D:/workspace
Close Eclipse. Delete
.metadata
and
.recommaditions
folders from your workplace. Import your projects back.
You add Project in to your workspace.
Start Eclipse and import project one option is ther copy to workspace do it.
After that add google play services it also copy in to your work space
and add it your library hope so its working.

Can not install google-play-services into Eclipse correctly (trying to get maps working)

My current wokspace setup looks like this:
However, people have told me that to get maps working, I also need to have "google-play-services_lib.jar" in my "Android Dependencies" folder, and the way to do that was through doing: "to Google Play Services into your project Project -> Properties -> Android -> Library, Add -> google-play-services_lib"
The only problem with that is it always after the initial green marker, it turns to a red cross when re-opening "Project -> Properties -> Android -> Library" ...and also no "google-play-services_lib.jar" gets added to "Android Dependencies" in the prooject
This question is an off-spring of this: Trying to get maps v2 Android demo working where I was told above was necessary to get maps working in my app. (Otherwise one gets error during inflating the XML containing the maps fragment.)
Have you tried to use Google APIs instead of Android 4.2.2? Using that will use Google Maps dependencies.
I just made a "working app" (it throws no errors but I was too lazy to make a key) using Google Maps v2 and not Google APIs as build but Android 4.1. This was my procedure.
Download the library from the SDK download manager.
Copied the folder "google-play-services_lib" which had this path ".../android-sdk/extras/google/google_play_services/libproject/google-play-services_lib" to another folder where I keep my libraries.
In Eclipse I chose New Project - Android Project from Existing Code. It got imported without any problems.
Right click the test project, click Properties - Android - Add - google-play-services_lib which now is in my workspace.
See if it works by trying to subclass com.google.android.gms.maps.MapFragment.
Please respond if you get any errors, if you do it right it will all work. Good luck.
First you need to delete your google-play-services project from your Package Explorer then you need to copy "google-play-service folder" from the directory C:/android-sdks.....google-play-service to your WORKSPACE then open Eclipse import the project "google-play-services" also from your WORKSPACE and then you can add the library...
Hope it helps:)

Why can't I add mopub-android-sdk as library?

I want to use MoPub for putting ads in my Android app.
I have downloaded the required resources and set-up a library project (mopub-android-sdk) in Eclipse. Now I want to add this project as a library to my Android app. But when I try to do that it gives this error:
Are the mopub-android-sdk files in the same parent folder as your project? This seems like the same problem addressed in this question/answer:
In eclipse, unable to reference an android library project in another android project
Place the referencing project in the same physical folder and see if the error persists.
To get around this, don't set up the mopub-sdk as a library project.
You can simply import it as a standard project.
Go to File > Import >Existing Projects Into Workspace, find the right project and click finish.
Right click your actual project and then click Build Path. Go to Link Source and then select the location of the project you just imported.
That should resolve the issue for you without requiring you to build a JAR.
-Franklin

Categories

Resources