Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Eclipse to recognize the maps api

Tags:

java

android

xml

Hi I'm developing an Android app and trying to incorporate maps into one of my sub-activities. Having followed all of the instructions from Android, my java file will not recognize the "MapActivity" or the import statements to include the needed api. Here is my XML manifest and my class file.

<?xml version="1.0" encoding="utf-8"?>

  <uses-permission android:name="android.permissions.INTERNET"/>
  <uses-permission android:name="android.permissions.ACCESS_FINE_LOCATION"/>

<application android:icon="@drawable/icon" android:label="@string/app_name">

 <uses-library android:name="com.google.android.maps" />  

    <activity android:name=".CadetCommand"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name="RedLight"></activity>
    <activity android:name="PTCalculator"></activity>

</application>
<uses-sdk android:minSdkVersion="7"/>

here is my java file:

    package edu.elon.cs.mobile;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;

public class LandNav extends MapActivity{

}

Any suggestion would help.


1 Answers

You have to use the "Google APIs by Google Inc." as SDK in eclipse, not the "SDK Platform Android".

If you don't have it available, it can be downloaded with the Android SDK and AVD manager (android-sdk/tools/android)

like image 91
rompetroll Avatar answered Jun 18 '26 06:06

rompetroll



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!