0

I'm trying to set up the google maps API for an application. I'm following this link: http://developer.android.com/guide/tutorials/views/hello-mapview.html

Yes, I got my own APK key in the xml and added all the manifest stuff they wanted. But my Java code is giving me an error:

import android.app.Activity;

import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.widget.Toast; import com.google.android.maps.MapActivity;

public class PathTracker extends MapActivity {

@Override
protected boolean isRouteDisplayed() {
    return false;
}

}

Apparently MapActivity is an undefined class, and my last import doesn't help.

Can anyone help me access the MapActivity class?

Thanks.

4

1 回答 1

1

您需要使用 Google APIs SDK 而不是普通的 Android SDK。您可以从 sdk 工具中的 android 应用程序下载此 SDK(与您想要的 API 级别匹配的 SDK)。然后在 Eclipse 中编辑您的项目并将其用作 SDK。

  1. 转到 android 工具(从 Eclipse,转到 Window -> Android SDK and AVD Manager)或在 android sdk 目录中查找可执行文件。
  2. 选择可用的软件包,展开第三方附加组件,展开 Google Inc,选择你想要的,然后下载它。
  3. 回到 Eclipse,右键单击您的项目,选择属性。在 Android 菜单下,选择您在步骤 2 中下载的 SDK 作为目标。
于 2011-07-15T23:21:08.267 回答