The Map Doesn't Show, only show Grid, and Show Grey Background

后端 未结 5 1998
感动是毒
感动是毒 2020-12-22 12:03

i just want to ask i want to make googlemaps apps on android.. i have follow instruction from many website (include from google developer) but the apps doesn\'t work on my r

5条回答
  •  猫巷女王i
    2020-12-22 12:38

    See here,just change the api key with your key in manifest file and follow these steps: and make sure that generate api key with package name which is mentioned in android manifest file and your google_play_services_lib project should be present in your project's work space only.

    Manifest file:

        
    
        
    
        
        
        
        
        
        
    
        
            
                
                    
    
                    
                
            
    
            
    
        
    
    
    

    MainActivity.java:

        package com.geeklabs.map;
    
    import android.os.Bundle;
    import android.app.Activity;
    import android.view.Menu;
    
    public class MainActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
    
    }
    

    activity_main.xml:

        
        
    

    After got this let me know.

    And make sure following steps done correct or not:

    Steps: * to ensure that device has Google Play services APK * to install Google Play Service rev. more than 2

    enter image description here

    • to create project at https://code.google.com/apis/console/
    • to enable "Google Maps Android API v2" enter image description here
    • to register of SHA1 in project (NOW, YOU NEED WRITE SHA1;your.app.package.name) at APIs console and get API KEY
    • to copy directory ANDROID_SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib to root of your project
    • to add next line to the YOUR_PROJECT/project.properties

    android.library.reference.1=google-play-services_lib

    • to add next lines to the YOUR_PROJECT/proguard-project.txt

    -keep class * extends java.util.ListResourceBundle {

    protected Object[][] getContents();

    }

    Okay, now you ready to create your own Google Map app with using Google Map APIs V2 for Android.

    If you create application with min SDK = 8, please use android support library v4 + SupportMapFragment instead of MapFragment.

提交回复
热议问题