Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7072777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:51:00+00:00 2026-05-28T05:51:00+00:00

i’ve a simple app that should show the device’s location on a map. the

  • 0

i’ve a simple app that should show the device’s location on a map. the app seems to work apart from the map does not load, but instead a grey grid. i’ve done some logging and looked at the stacktrace. it mentions that MapActivity couldn’t get connection factory client.
i’ve looked at several threads on this but i can’t find an answer.

once the app is running it just cycles between onDraw and onLocationChanged, endlessly. i’ve created a MapView apiKey, also the correct permissions are in the manifest. Any ideas what i could do? thanks.

[edit] i’ve walked around outside aswell, because gps no in building:)

[edit2]i’ve also tried to regenerate a different md5 fingerprint to generate another apikey but the keytool generates the same md5 fingerprint. it alias matt already exists.

[edit3] I’ve also generated a different MD5 fingerprint by using a different alias in the keytool. This made a different API KEY, unfortunately it still doesn’t work

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:orientation="vertical" android:layout_width="match_parent" 
                android:layout_height="wrap_content" android:gravity="fill">
   <com.google.android.maps.MapView
        android:id="@+id/myGMap"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="0??????syQI//C13Y-pRUNaA0a_??????pr86jE2w"
     />

   <EditText android:id="@+id/edittext1" 
             android:inputType="text"
             android:layout_width="fill_parent" 
             android:layout_height="wrap_content" 
             />

   <Button android:layout_height="wrap_content" 
          android:layout_width="wrap_content" 
          android:text="CLOSE"
          android:layout_alignParentRight="true"  
          android:id="@+id/close" ></Button> 

</RelativeLayout>

.

<?xml version="1.0" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.tecmark"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" />
     <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <activity
            android:name=".WcFinderActivity"
            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" />
    </application>



</manifest>

.

import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;


import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ZoomControls;

public class WcFinderActivity extends MapActivity implements LocationListener {
    /** Called when the activity is first created. */



    private MapView         gMapView        = null;
    private MapController   mc              = null;
    private Drawable        defaultMarker   = null;
    private GeoPoint        p               = null;
    private double          latitude        = 18.9599990845;
    private double          longitude = 72.819999694;
    private Context         mContext = this;

    private static final String TAG = "WcFinderActivity";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Log.e(TAG, "**********inside oncreate");

        EditText editText = (EditText)findViewById(R.id.edittext1);


        // Creating and initializing Map
        gMapView = (MapView) findViewById(R.id.myGMap);
        p = new GeoPoint((int) (latitude * 1000000), (int) (longitude * 1000000));
        gMapView.setSatellite(true);
        mc = gMapView.getController();
        mc.setCenter(p);
        mc.setZoom(14);

        // Add a location mark
        MyLocationOverlay myLocationOverlay = new MyLocationOverlay();
        List<Overlay> list = gMapView.getOverlays();
        list.add(myLocationOverlay);

        // Adding zoom controls to Map
        ZoomControls zoomControls = (ZoomControls) gMapView.getZoomControls();
        zoomControls.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT));

        gMapView.addView(zoomControls);
        gMapView.displayZoomControls(true);

        // Getting locationManager and reflecting changes over map if distance travel by
        // user is greater than 500m from current location.
        Log.e(TAG, "**********about to call getSystemService");
        LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        Log.e(TAG, "**********about to call requestLocationUpdates");
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
        lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);



        Button close = (Button)findViewById(R.id.close);
        close.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                Log.e(TAG,"clicked close");

            finish();

            }});

    }

    /* This method is called when use position will get changed */
    public void onLocationChanged(Location location) {
        if (location != null) {
            Log.e(TAG, "**********inside onLocationChanged");
            double lat = location.getLatitude();
            double lng = location.getLongitude();

            p = new GeoPoint((int) lat * 1000000, (int) lng * 1000000);
            mc.animateTo(p);
        }
    }

    public void onProviderDisabled(String provider) {
        // required for interface, not used

        Log.e(TAG, "**********inside onProviderDisabled");
    }

    public void onProviderEnabled(String provider) {
        // required for interface, not used
        Log.e(TAG, "**********inside onProviderEnabled");
    }

    public void onStatusChanged(String provider, int status, Bundle extras) {
        // required for interface, not used
        Log.e(TAG, "**********inside onStatusChanged");
    }

    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        Log.e(TAG, "**********inside isRouteDisplayed");
        return false;
    }

    /* User can zoom in/out using keys provided on keypad */
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_I) {
            gMapView.getController().setZoom(gMapView.getZoomLevel() + 1);
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_O) {
            gMapView.getController().setZoom(gMapView.getZoomLevel() - 1);
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_S) {
            gMapView.setSatellite(true);
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_T) {
            gMapView.setTraffic(true);
            return true;
        }
        return false;
    }

    /* Class overload draw method which actually plot a marker,text etc. on Map */
    protected class MyLocationOverlay extends com.google.android.maps.Overlay {

        @Override
        public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {

            super.draw(canvas, mapView, shadow);
            Paint paint = new Paint();
            Log.e(TAG, "**********inside onDraw");
            // Converts lat/lng-Point to OUR coordinates on the screen.
            Point myScreenCoords = new Point();
            mapView.getProjection().toPixels(p, myScreenCoords);

            paint.setStrokeWidth(1);
            paint.setARGB(255, 255, 255, 255);
            paint.setStyle(Paint.Style.STROKE);
            paint.setColor(Color.RED);


            canvas.drawCircle(myScreenCoords.x, myScreenCoords.y, 20, paint);
            canvas.drawText("I am here...", myScreenCoords.x, myScreenCoords.y, paint);
            return true;
        }
    }
}

.

01-19 16:13:59.698: D/ddm-heap(2294): Got feature list request
01-19 16:14:00.893: E/WcFinderActivity(2294): **********inside oncreate
01-19 16:14:01.073: E/WcFinderActivity(2294): **********about to call getSystemService
01-19 16:14:01.083: D/LocationManager(2294): Constructor: service = android.location.ILocationManager$Stub$Proxy@43cf74d8
01-19 16:14:01.083: E/WcFinderActivity(2294): **********about to call requestLocationUpdates
01-19 16:14:01.398: I/MapActivity(2294): Handling network change notification:CONNECTED
01-19 16:14:01.398: E/MapActivity(2294): Couldn't get connection factory client
01-19 16:14:01.438: E/WcFinderActivity(2294): **********inside isRouteDisplayed
01-19 16:14:01.613: D/dalvikvm(2294): GC freed 3423 objects / 218896 bytes in 81ms
01-19 16:14:02.003: D/dalvikvm(2294): GC freed 6408 objects / 380712 bytes in 87ms
01-19 16:14:02.283: E/WcFinderActivity(2294): **********inside onDraw
01-19 16:14:02.378: D/dalvikvm(2294): GC freed 10136 objects / 744376 bytes in 77ms
01-19 16:14:02.383: E/WcFinderActivity(2294): **********inside onDraw
01-19 16:14:02.423: E/WcFinderActivity(2294): **********inside onLocationChanged
01-19 16:14:02.448: E/WcFinderActivity(2294): **********inside onLocationChanged
01-19 16:14:02.493: E/WcFinderActivity(2294): **********inside isRouteDisplayed
01-19 16:14:02.523: E/WcFinderActivity(2294): **********inside onDraw
01-19 16:14:02.528: E/WcFinderActivity(2294): **********inside onDraw
01-19 16:14:02.578: E/WcFinderActivity(2294): **********inside isRouteDisplayed
01-19 16:14:02.603: E/WcFinderActivity(2294): **********inside onDraw
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:51:01+00:00Added an answer on May 28, 2026 at 5:51 am

    did you obtained the api key for your debug certificate? If not then that’s your problem.

    try reading this article to see how you can do that

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.