1. Download our Official Android App: Forums for Android!

Google MapView Help

Discussion in 'Android Apps & Games' started by GeorgeFrost, Jul 1, 2011.

  1. GeorgeFrost

    GeorgeFrost Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jul 1, 2011

    Jul 1, 2011
    1
    0
    5
    Hi,

    Ive read all the other help on this forum about the MapView but I still can't get it to display the tiles.

    Ive checked multiple times:
    that I have added the INTERNET permission
    That my APIKey is correct
    That the maps library is added inside the application tags

    Here is my code:

    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.       package="com.android.UniGPS"
    4.       android:versionCode="1"
    5.       android:versionName="1.0">
    6.      
    7.     <application android:icon="@drawable/icon" android:label="@string/app_name">
    8.         <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    9.         <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    10.         <uses-permission android:name="android.permission.INTERNET" />
    11.        
    12.         <activity android:name=".UniGPS"
    13.                   android:label="@string/app_name">
    14.             <intent-filter>
    15.                 <action android:name="android.intent.action.MAIN" />
    16.                 <category android:name="android.intent.category.LAUNCHER" />
    17.             </intent-filter>
    18.         </activity>
    19.         <uses-library android:name="com.google.android.maps" />
    20.     </application>
    21.    
    22. </manifest>
    Code (Text):
    1. package com.android.UniGPS;
    2.  
    3. import android.os.Bundle;
    4. import com.google.android.maps.MapActivity;
    5. import com.google.android.maps.MapView;
    6.  
    7. public class UniGPS extends MapActivity {
    8.    
    9.     MapView mapView;
    10.    
    11.     @Override
    12.     public void onCreate(Bundle savedInstanceState) {
    13.         super.onCreate(savedInstanceState);
    14.         setContentView(R.layout.main);
    15.        
    16.         mapView = (MapView) findViewById(R.id.mapview);
    17.         mapView.setBuiltInZoomControls(true);
    18.     }
    19.  
    20.     @Override
    21.     protected boolean isRouteDisplayed() {
    22.         return false;
    23.     }
    24.    
    25. }
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    3.     android:id="@+id/mainlayout"
    4.     android:orientation="vertical"
    5.     android:layout_width="fill_parent"
    6.     android:layout_height="fill_parent" >
    7.  
    8.      <com.google.android.maps.MapView
    9.                  android:id="@+id/mapview"
    10.                  android:layout_width="fill_parent"
    11.                  android:layout_height="wrap_content"
    12.                  android:apiKey="0Dj81s0S26kxIuiqRRH5hLbqcTuTODBclAzkMqw"
    13.                  android:clickable="true"
    14.                  />
    15.  
    16. </RelativeLayout>
     

    Advertisement

  2. takeshi

    takeshi Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    3,354
    Joined:
    Dec 6, 2009

    Dec 6, 2009
    3,354
    283
    163
    You'll have better luck with dev questions in a dev forum.
     

Share This Page

Loading...