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 8408059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:32:18+00:00 2026-06-09T23:32:18+00:00

I don’t know what my problem is, the Google map is not showing I

  • 0

I don’t know what my problem is, the Google map is not showing

look

I have change the project property to Google API 2.3.3 and no errors are displaying

here’s my code:

Mapping.java

package com.mapping;

import java.io.IOException;
import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;

public class Mapping extends MapActivity {

    private MapView mapView = null;
    private Geocoder geoCoder = null;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);

        // latitude and longitude of Dallas, TX
        // set as starting point 
        int lat = (int)(37.422006 * 1000000); //the geocoder requires integers...
        int lon = (int)(-122.084095 * 1000000);
        //make these into a GeoPoint:
        GeoPoint startPoint = new GeoPoint(lat, lon);
        mapView.getController().setZoom(12);
        mapView.getController().setCenter(startPoint);

        geoCoder = new Geocoder(this);
    }

    public void mapHandler(View v) {
        switch(v.getId()) {
        case R.id.btnSat:
            mapView.setSatellite(true);
            break;
        case R.id.btnTraf:
            mapView.setTraffic(true);
            break;
        case R.id.btnNorm:
            mapView.setSatellite(false);
            mapView.setTraffic(false);
            break;          
        }
    }

    public void geocode(View v) {
        EditText geoLocation = (EditText) findViewById(R.id.txtLocation);
        if(Geocoder.isPresent()) {
            try {
                String addr = geoLocation.getText().toString();

                List<Address> locationList = geoCoder.getFromLocationName(addr, 5);
                if(locationList != null && locationList.size() > 0) {
                    int lat = (int)(locationList.get(0).getLatitude() * 1000000);
                    int lon = (int)(locationList.get(0).getLongitude() * 1000000);

                    GeoPoint setPoint = new GeoPoint(lat, lon);
                    mapView.getController().setZoom(14);
                    mapView.getController().setCenter(setPoint);
                }
            } catch (IOException error) {
                Log.i("Caught IOException", "-----Printing Stack Trace-----");
                error.printStackTrace();
            }
        } else {
            geoLocation.setText("No Geocoder Available");
        }
    }

    protected boolean isLocationDisplayed() {
        return false;
    }

    protected boolean isRouteDisplayed() {
        return false;
    }
}

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btnSat" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Satellite"
            android:onClick="mapHandler" />

        <Button 
            android:id="@+id/btnTraf"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Traffic"
            android:onClick="mapHandler" />

        <Button 
            android:id="@+id/btnNorm"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Normal"
            android:onClick="mapHandler" />

    </LinearLayout>

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <EditText
            android:id="@+id/txtLocation"
            android:layout_width="200sp"
            android:layout_height="wrap_content"
            android:text="Dallas" />

        <Button 
            android:id="@+id/btnGeocode"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Find Location"
            android:onClick="geocode" />

    </LinearLayout>

    <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:apiKey="0G_pKeFNWX5lw7PQ7AzKnl2XbRs7bHZ3p6ECosQ" />
</LinearLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mapping"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps" />
    </application>

</manifest>

Can anyone help me? I’ve pulling my hair all day. The program is running okay, as you can see I was able to take a screen shot so it must be the connection of the device to the Google API. I can’t seem to find the error…

  • 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-09T23:32:20+00:00Added an answer on June 9, 2026 at 11:32 pm

    Don’t use existing map api key or anything else. You have to generate your own map api key with your md5 fingerprint code. Just have a look at below links –

    1. Android Map api key

    2. maps-api-signup

    Have a look at existing answer. And, here is a best example for generating map api key with step-by-step. These may helps you surely.

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

Sidebar

Related Questions

Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
Don't know how to google for such, but is there a way to query
Don't know why people do not practice AJAX implementation for authentication systems. Is it
I don't know if this question is trivial or not. But after a couple
Don't know if this is an eclipse specific problem but whenever I declare a
I don't know why this double json response are not successful: [{first_content:content,...}][{second_content:content,...}] So i
Don't know if this has been answered before. Have custom routes to users. If
Don't know if I'm over-thinking this or not.. but I'm trying to be able
Don't know why but I can't find a solution to this. I have 3
Don't know the term for the red validation border, does it have one? I

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.