0 Replies - 800 Views - Last Post: 22 August 2013 - 12:57 AM

#1 sanwall   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 57
  • Joined: 07-March 10

Displaying Google maps

Posted 22 August 2013 - 12:57 AM

I want to display Google maps but I shows only white blank tiles. I tested code in Google APIs level 17 emulator and android 4.1 device but no results! Kindly Cooperate with me!

Manifest File code,

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

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

<uses-permission android:name="com.example.flood.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


<uses-feature
               android:glEsVersion="0x00020000"
               android:required="true"/>
      
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >  
        
        <activity
            android:name="com.example.flood.MainActivity"
            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"/> 
      
        <meta-data
     android:name="com.google.android.maps.v2.API_KEY"
    android:value="Here I put my API key "/>
                
    </application>

</manifest>







Xml File code,


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
   
    
    <com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="I put my key here"
    />
    
    

</LinearLayout>









Java code,

package com.example.flood;

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

import android.os.Bundle;

public class MainActivity extends MapActivity {

	MapView map;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        map=(MapView) findViewById(R.id.mapview);
        map.setBuiltInZoomControls(true);
        
    }

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
}




Is This A Good Question/Topic? 0
  • +

Page 1 of 1