java - 让 Eclipse 识别 map api

标签 java xml android

您好,我正在开发一个 Android 应用程序并尝试将 map 合并到我的一个子 Activity 中。按照 Android 的所有说明进行操作后,我的 java 文件将无法识别“MapActivity”或包含所需 api 的导入语句。这是我的 XML list 和我的类文件。

<?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"/>

这是我的java文件:

    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{

}

任何建议都会有所帮助。

最佳答案

您必须使用“Google Inc. 的 Google API”。作为 Eclipse 中的 SDK,而不是“SDK Platform Android”。

如果您没有,可以使用 Android SDK 和 AVD 管理器 (android-sdk/tools/android) 下载

关于java - 让 Eclipse 识别 map api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2767660/

相关文章:

java - XmlPullParser getAttributeValue 总是返回 null

android - 如何在 kotlin 中以编程方式更改文本颜色

java - 从sqlite android获取所有记录

java - Spring 有代码质量工具吗?

java - Android addToBackStack(null) 不起作用,关闭应用程序

android - 如何在父 View 中处理 subview 的触摸事件

Android 开发 - 回调 URL 无效... (0_o)

java - Libgdx 使用 glClearColor 调暗屏幕

java - 异步和同步模式的并发

java - 如何让一个集合保留包含我在java中指定子字符串的所有字符串?