Help can't import com.google.android.maps - android

I already tell project use libraries com.google.android.maps in the manifest of project but in my activity it shows errors about importing com.google.android.GeoPoint. and others.

which target version you are using? use target Google apis 1.6 instead of android. You can the change the target version from project itself.
1.Right click on the project
2. choose Build path--> Configure Build path
3.Window will be opened, choose Android in right corner of the window then change target version in to Google apis.

Based on the short described question, i can assume below:
Yes you have mentioned it inside the AndroidManifest.xml file but have you choosen the library instead of SDK while creating android application. If no, then you just need to select Google API (Google Inc.).

You can mention it on the AndroidManifest.xml but first of all choose google api sdk.

First you have to make sure you have installed Google API
Then set your project's properties in Eclipse to check off the Google APIs version of the SDK.
and Make sure you have include this library in AndroidManifest FIle
<uses-library
android:name="com.google.android.maps" />

//in AndroidManifest.xml >>uses-library android:name = "com.google.android.maps"/>
then add maps.jar search for maps.jar and coppy path in your computer
example:C:\Users\android\sdk\add-ons\addon-google_apis-google-17\libs\maps.jar
then right click on your projects >>Build Path >> Configure Build Path..>>Java Build Path>>Libraries taps >>Add External jars..>>past path:C:\Users\android\sdk\add-ons\addon-google_apis-google-17\libs\maps.jar>>choose maps.jar click ok..ends thank you.

Related

How to import com.google.android package.?

I want to create an activity which will extends MapActivity class.
But I am unable to import com.google.android.maps.MapActivity
It is showing following error:
the import com.google can not be resolved
You have to build you project with Google Api's Library. It looks you are building it with general Android Api.
Do the following steps to get rid of your error.
Right Click on Project ---> Properties ---> Android ---> Select Google
Apis (any api level)--->Click Apply.
Bring up your project properties, and go to Android. Do you have an Android target selected that includes the Google APIs? Perhaps you just have a generic Android target.
First you have to make sure you have installed Google API
Then set your project's properties in Eclipse to check off the Google APIs version of the SDK.
and Make sure you have include this library in AndroidManifest FIle
<uses-library android:name="com.google.android.maps" />

Importing project gave Unable to resolve target 'android-7'

This app I completed around a year ago (!) but never launched it on the market place. I am trying to open it up in eclipse now to make some small modifications and work on the code a little bit. So I imported it and then found this weird "unable to resolve target" error. It's highlighting every class red in all my 'src' files.
I've looked at a similar question which said to add the line to default.properties file. My project has a project.properties file which has the line:
target=android-7
Any advice how to get this to work? I could always start a new project and just copy all the src files but that would be pretty lame and time-wasting.
One more comment - I'm developing on a new computer and I don't think I have the API level 7. Could that be the problem? I've gone into Window --> Android SDK Manager and the oldest available API it shows is level 8. But level 7 will mean I can target more devices I think so I'd like to go with that.
Thank you for any help.
Well, yes that is your problem. You don't have the API level 7 downloaded. You can right click the project and go properties->android and select another available API. As long as you don't change the min sdk version in your manifest you are still targeting as many devices as before.
<uses-sdk android:minSdkVersion="7"/>
Update
You don't have to do this, but you can get the older APIs on the SDK Archives page
I don't know if there is any official source for the next statement but that is what I found while working. If anybody can complete this with a better answer I would appreciate it very much.
You can compile the code with a newer SDK version as long as you don't use any code not compatible to the previous ones.
Example:
I want my app to be available for API level 7. But i only have API level 15 installed. As long as I keep the minSdkVersion="7" in my Manifest and don't use any resource not available in the previous APIs the app will work just fine on my targeted devices.
For anyone who wants to test their project against an API level that isn't the most recent one, you can just use the SDK Manager to install the old SDK:
In Eclipse (with adt installed):
SDK Manager:
Just check the box of the SDK you want to use to test against your project and click install. You can also remove API's that you aren't using.
Right click on your project then:
Properties -> Android -> Project build target -> Check Android 4.1.2
In your application's manifest.xml file add this tag
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
It's worked for me. Try it.
I resolved this issue by editing my project.properties file
from: target=android-7
to: target=android-19.
I also changed the target sdk version in the manifest file:
android:targetSdkVersion="19".
Yes. I see the same problem when I import the android support v7 project as a library project in my own project,the eclipse says that cannot resolve android16, I find that it's the problem of the eclipse,you can right-click your project which has this problem,and then select properties,the Android pane,there is a Project Build Target pane there,you can see it easily,choose a standard android platform,like Android4.3,not others that start with Google API,I hope that this will help you!
check android:minSdkVersion= in the AndroidManifest.xml
update target=android- in the project.properties if you use Eclipse IDE

Can not import com.google.android.maps.MapActivity

I try to import com.google.android.maps.MapActivity but my program can not recognize it. I also have <uses-library android:name="com.google.android.maps" />
and set the apiKey in my project.
Can anybody explain why I can import the above line?
Thanks in advance.
What Android Version to you use ? On your project Settings make sure that you use a Project Build Target that contains the google api. Normally they are names "Google APIs".
I included an image of the project settings.
Right click in your project and select Properties, then select Android > Google APIs from Google Inc. version 2.2 or above. Be sure to choose any of the Google APIs instead of the Android 2.2 or above APIs since only Google APIs have the android.maps library.

MapActivity cannot be resolved to a type

I'm busy trying to get the MapView included in my Android project. I'm following the MapView tutorial on the Android developer website but I'm getting an error:
'MapActivity cannot be resolved to a type'
I tried pressing Ctrl+Shift+O to auto import all classes but it's not helping. When I try to include the Maps libary manually it gives this error:
'The import com.google.android cannot be resolved'
I have added the following line (see below) to the Manifest and my target is API 7 (Platform: 2.1).
<uses-library android:name="com.google.android.maps" />
What am I doing wrong?
Thanks!!!
You need to reference correct library at compile time. But what you describe is asking Android to use this specific library at runtime.
You need to right click your Eclipse project, Properties -> Android. In Project Build Target select any target with vendor Google Inc..
Google API is a third party SDK. Choose third party in packages manager.

Error - The import com.google can not be resolved

I am new to android development. I got an error when I wrote the code
import com.google.android.maps.MapView;
in eclipse. The error is The import com.google can not be resolved.
Please anybody give suggestion to fix this problem.
Bring up your project properties, and go to Android. Do you have an Android target selected that includes the Google APIs? Perhaps you just have a generic Android target.
As Jim said, you have to select "Google APIs" (which is Android x.x + Google APIs) instead of something like "Android 2.2" in your project's properties.
First you have to make sure you have installed Google API
Then set your project's properties in Eclipse to check off the Google APIs version of the SDK.
and Make sure you have include this library in AndroidManifest FIle
<uses-library
android:name="com.google.android.maps" />

Categories

Resources