google map not working on both emulator and device

前端 未结 3 1661
自闭症患者
自闭症患者 2020-12-20 07:33

I am trying to run a simple google map but its not working its showing only map background.checked on both emulator and device.

xml file:-



        
3条回答
  •  生来不讨喜
    2020-12-20 07:49

    In order to use google Map Service,

    Please visit code.google.com and get you ApiKey.

    create a project there->go to services->Activate the Google Maps Android API v2. Then Create Key for your application.

    Add the following permissions to your manifest.

     
        
        
        
        
        
    

    use

     
    

    also add

    
    
        
    

    inside your Application Tag in manifest.

    Use

    map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
            .getMap();
    

    in your code.

    and set the other required properties. Now Run the Application.

提交回复
热议问题