1

I followed the instruction given in the net by you in https://blog-emildesign.rhcloud.com/?p=435, I made the app & try to run it by my Galaxy S IV, but getting blank screen with + and - button, for your convince I am also giving all the files of the project to you. Please help me.

1.AndroidManifest.xml

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

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="17" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>

<permission android:name="com.example.mapwithgps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapwithgps.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.mapwithgps.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>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyCNChGhmjHFvLp4atblSojMLvnnfg-_QZA" />


</application>

</manifest>

2.activity_main.xml

<?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" >

<fragment
    android:name="com.google.android.gms.maps.SupportMapFragment"

    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
</LinearLayout>

3.MainActivity.java

package com.example.mapwithgps;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;


public class MainActivity extends FragmentActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

}

Please help me to run the application.

2 Answers2

1

it seems like you have problem with api key !

try http://www.vogella.com/articles/AndroidGoogleMaps/article.html tutorial with all steps!

Tarsem Singh
  • 14,139
  • 7
  • 51
  • 71
-1

I see you have stumbled on my Google Maps Guide. Well fist of all if you minSDKVersion is 14, there is no point in using the FragmentActivity and SupportMapFragment objects, you can just change them to a simple Activity and a MapFragment.

Second if you followed all the steps of this guide and you still have a problem of a blank map with zoom controls I would suggest you to go over this guide as well:

Google Maps API V2 Key

and make sure that you produced the key and configured it correctly in the Google API Console.

Emil Adz
  • 40,709
  • 36
  • 140
  • 187