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

  • Home
  • SEARCH
  • 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 8131261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:02:29+00:00 2026-06-06T09:02:29+00:00

I want to display google map in Android ,i have map API even map

  • 0

I want to display google map in Android ,i have map API even map is not showing and also not throwing any error.
I have use following
Java code

public class GoogleMapActivity extends MapActivity {
    private Location myLocation;
    protected MapView myMapView = null;
    protected LocationManager myLocationManager = null;
    protected MapController mapController;
    List<Overlay> mapOverlays;

    protected boolean isRouteDisplayed() {
        return false;
    }

    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        this.myMapView = new MapView(this, "0jzIB6m5R1kLa_rGte-DS9PhF3KlSgqYHUZognA");    
        this.setContentView(myMapView);
        myMapView.setBuiltInZoomControls(true);
        myMapView.setSatellite(true);
        mapController = myMapView.getController();
        mapOverlays = myMapView.getOverlays();
        this.myLocation = new Location("gps");
        this.myLocation.setLongitude(77.52436144125092);
        this.myLocation.setLatitude(13.05096452223662);
        updateView();
    }

    private void updateView() {
        Double lat = myLocation.getLatitude();
        Double lng = myLocation.getLongitude();
        GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
        mapController.setCenter(point);
    }
}

Manifest

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

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

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".GoogleMapActivity"
            android:label="@string/app_name" >
            <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>

Finally i get output blank. please have a look at below screen

image

on please suggest me where i’m wrong

  • 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-06T09:02:32+00:00Added an answer on June 6, 2026 at 9:02 am

    I think you have not added myMapView in current layout ………..

    you created in java code

    this.myMapView = new MapView(this,
                    "0jzIB6m5R1kLa_rGte-DS9PhF3KlSgqYHUZognA");
    

    but looks not added in any layout.. as per link

    1. If you dynamically create the MapView via its constructor, you can
      supply the API key that way from Java code, but then you will need to
      dynamically add it to your layout.
    2. You cannot both have the widget in your layout and set the API key
      in Java.

    Solutions :

    • option 1 – Create a Linear layout in for XML and add the myMapView
      in that.
    • option 2 -Create Map view in XML it self and get that by
      findViewById.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to display google map in android emulator. i also follow the step
I want to Display Google Map into my wordpress site. I have used below
I have points on the google map v3. I want to display information about
I have the below in a google map application and want to display the
I have been searching on the Google Map API V3 documentation but I could
i have to display google map in my php code. for that i have
I have these bits here that will display a google map link for me.
I have a present need to display a Google Map, inside a FancyBox. The
i have a form to enter directions and display a google map <form action=#
I have divided the my google map display in to numbers of parts, Now

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.