Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9317127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:47:57+00:00 2026-06-19T02:47:57+00:00

Hi Im playing around with an android map app tutorial, but I’m getting lots

  • 0

Hi Im playing around with an android map app tutorial, but I’m getting lots of errors because I dont seem to be importing the com.google.andoid.maps package properly because eclipse is giving me an error for the import and any of its classes. Is there any reason why it shouldnt be working.

import com.google.android.maps.*;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class ShowTheMap extends MapActivity {

    private static double lat;
    private static double lon;
    private int latE6;
    private int lonE6;
    private MapController mapControl;
    private GeoPoint gp;
    private MapView mapView;

    private Button overlayButton, accessButton;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);  // Suppress title bar for more space
        setContentView(R.layout.showthemap);

        // Add map controller with zoom controls
        mapView = (MapView) findViewById(R.id.mv);
        mapView.setSatellite(false);
        mapView.setTraffic(false);
        mapView.setBuiltInZoomControls(true);   // Set android:clickable=true in main.xml

        int maxZoom = mapView.getMaxZoomLevel();
        int initZoom = maxZoom-2;

        mapControl = mapView.getController();
        mapControl.setZoom(initZoom);
        // Convert lat/long in degrees into integers in microdegrees
        latE6 =  (int) (lat*1e6);
        lonE6 = (int) (lon*1e6);
        gp = new GeoPoint(latE6, lonE6);
        mapControl.animateTo(gp);    

        // Button to control food overlay
        overlayButton = (Button)findViewById(R.id.doOverlay);
        overlayButton.setOnClickListener(new OnClickListener(){      
            public void onClick(View v) {   

            }
        });

        // Button to control access overlay
        accessButton = (Button)findViewById(R.id.doAccess);
        accessButton.setOnClickListener(new OnClickListener(){      
            public void onClick(View v) {   

            }
        });

    }

    // Method to insert latitude and longitude in degrees
    public static void putLatLong(double latitude, double longitude){
        lat = latitude;
        lon =longitude;
    }

    // This sets the s key on the phone to toggle between satellite and map view
    // and the t key to toggle between traffic and no traffic view (traffic view
    // relevant only in urban areas where it is reported).

    public boolean onKeyDown(int keyCode, KeyEvent e){
        if(keyCode == KeyEvent.KEYCODE_S){
            mapView.setSatellite(!mapView.isSatellite());
            return true;
        } else if(keyCode == KeyEvent.KEYCODE_T){
            mapView.setTraffic(!mapView.isTraffic());
            mapControl.animateTo(gp);  // To ensure change displays immediately
        }
            return(super.onKeyDown(keyCode, e));
    }

    // Required method since class extends MapActivity
    @Override
    protected boolean isRouteDisplayed() {
            return false;  // Don't display a route
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T02:47:58+00:00Added an answer on June 19, 2026 at 2:47 am

    This sounds like it may just be that you are missing the needed packages. Make sure you download the Google APIs in Eclipse with the SDK Manager.

    Take a look at this page for some details. https://developers.google.com/android/add-ons/google-apis/installing

    A quick snippet from that page mentions this sort of issue

    Select the Google APIs Add-On that you want to install and click
    Install Selected. The add-on is downloaded to your computer and
    installed in your SDK environment.

    When you are ready to develop against the add-on. set your
    application’s properties so that it uses the Google APIs Add-On as the
    build target. To run the application, create an Android Virtual Device
    that uses the add-on as it’s target. Make sure to select the version
    (by API level) that is appropriate for your app.

    To give your applications access to the Maps library included in the
    add-on, you need to configure your development and run-time
    environments properly. The process for doing that is described in the
    Maps Overview document, which you should read next.

    1. Open the SDK Manager in Eclipse
    2. Find your API version
    3. Check the box Google APIs by Google Inc
    4. Click Install # packages
    5. Restart Eclipse

    For example

    enter image description here

    After that you to reference those new packages so you need to change your Project Build Target

    1. Right click your project
    2. Open Properties
    3. Go to the Android section
    4. Check the box next to Google APIs for the API version you’re looking for

    For example

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm interested in playing around with the Android OS, but I do not need
OK, so I'm playing around with an android app. The 90% use case is
I'm playing around with reading the signal strengths in a small Android App, and
I'm currently playing around with App Widgets in Android and I'm a little confused
I'm playing around with Beam and NFC but I only own one android device,
I am playing around with HTML 5 apps according to this tutorial: http://sixrevisions.com/web-development/html5-iphone-app/ It's
currently I'm playing around with Android-SDK. The BroadcastReceiver is really interesting, because I can
I have been playing around with my phonegap app in eclipse using android sdk
I'm pretty new to Android app development, and I've been playing around with swipe
I'm currently getting to grips with Android, playing around with the Lunar Lander sample.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.