I am trying to create an application that connects to Google maps. But when the screen loads, when the card should just be gray. How to fix it?
Important message from my logcat.
06-11 03:32:55.196: E/Google Maps Android API(11671): Ensure that the following correspond to what is in the API Console: Package Name: my pacakage, API Key: my key, Certificate Fingerprint: my fingerprint
Activities
import android.os.Bundle; import android.view.Menu; import android.support.v4.app.FragmentActivity; public class mapPage extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_page); } @Override public boolean onCreateOptionsMenu(Menu menu) {
manifest
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my package" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <permission android:name="my package.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="my package.permission.MAPS_RECEIVE"/> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <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" > <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my key"/> <activity android:name="my package.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> <activity android:name=".main"> </activity> <activity android:name=".mapPage"> </activity> <activity android:name=".ThirdPartyWeb" android:theme="@android:style/Theme.Dialog"> </activity> </application> </manifest>
Layout
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_alignParentTop="true" android:layout_centerInParent="true" android:layout_height="250dp" android:layout_width="fill_parent" class="com.google.android.gms.maps.SupportMapFragment"/> <ImageView android:layout_alignParentTop="true" android:layout_centerInParent="true" android:layout_height="50dp" android:layout_width="fill_parent" android:background="@color/darkGrey"/> <Button android:layout_alignParentTop="true" android:layout_marginTop="10dp" android:layout_alignParentLeft="true" android:id="@+id/menuButton" android:background="@drawable/icon_menu" android:layout_height="30dp" android:layout_width="30dp"/> <Button android:layout_alignParentTop="true" android:layout_marginTop="10dp" android:layout_toRightOf="@+id/menuButton" android:layout_marginLeft="20dp" android:id="@+id/" android:background="@drawable/icon_off" android:layout_height="35dp" android:layout_width="55dp"/> <EditText android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_marginTop="10dp" android:layout_toRightOf="@+id/" android:layout_marginLeft="20dp" android:layout_toEndOf="@+id/" android:id="@+id/seachBox" android:hint="@string/search" android:layout_height="35dp" android:layout_alignParentEnd="true" android:background="@color/white"/> <Button android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_marginTop="10dp" android:id="@+id/searchButton" android:background="@drawable/graphic_search" android:layout_height="35dp" android:layout_width="20dp"/> <ImageView android:layout_above="@+id/newsFeed" android:layout_centerInParent="true" android:layout_height="35dp" android:layout_width="fill_parent" android:background="@color/darkGrey"/> <TextView android:layout_alignParentLeft="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_above="@+id/newsFeed" android:layout_marginBottom="11dp" android:textColor="@color/white" android:text="@string/news_feed" android:textAppearance="?android:attr/textAppearanceSmall"/> <ListView android:layout_alignParentBottom="true" android:id="@+id/newsFeed" android:layout_width="fill_parent" android:layout_height="wrap_content">" </ListView> </RelativeLayout>
source share