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 7420139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:11:18+00:00 2026-05-29T08:11:18+00:00

I am trying to create an app that will obtain the users location via

  • 0

I am trying to create an app that will obtain the users location via gps, display the users location in google maps, and then update after a certain amount of time/movement.

I currently have an app that will obtain the users location via gps and update itself every 10meters/10,000 miliseconds, but currently all it does is display what the coordinates are. I have it set up to connect to google maps, but at the minute it is simply setting the map to some coordinates that I have manually entered myself.

How do I get it so the map will display the location based on the coordinates obtained via gps?

Any help would be greatly appreciated, I am very new to all this!

EDIT: heres my code so far!

package com.android.basicmap;

import com.google.android.maps.MapActivity;
import android.os.Bundle;
import com.google.android.maps.MapView;
import com.google.android.maps.MapController;
import com.google.android.maps.GeoPoint;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;

public class BasicMapActivity extends MapActivity {

private MapView mapView;
private MapController mapController;

private LocationManager locationManager;
private LocationListener locationListener;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);  

    locationListener = new GPSLocationListener();

    locationManager.requestLocationUpdates(
      LocationManager.GPS_PROVIDER, 
      0, 
      0, 
      locationListener);

    mapView = (MapView) findViewById(R.id.mapView);
    mapView.setStreetView(true);
    mapView.setBuiltInZoomControls(true);

    mapController = mapView.getController();
    mapController.setZoom(16);
}

@Override
protected boolean isRouteDisplayed() {
  return false;
}

private class GPSLocationListener implements LocationListener 
{
  @Override
  public void onLocationChanged(Location location) {
    if (location != null) {
      GeoPoint point = new GeoPoint(
          (int) (location.getLatitude() * 1E6), 
          (int) (location.getLongitude() * 1E6));

      Toast.makeText(getBaseContext(), 
          "Latitude: " + location.getLatitude() + 
          " Longitude: " + location.getLongitude(), 
          Toast.LENGTH_SHORT).show();

      mapController.animateTo(point);
      mapController.setZoom(16);
      mapView.invalidate();
    }
  }


}

}

  • 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-29T08:11:19+00:00Added an answer on May 29, 2026 at 8:11 am

    Here’s a full-blown tutorial on that: http://www.codeproject.com/Articles/112044/GPSLocator-App-to-Find-Current-Nearest-Location-us

    But come on, I found that by entering “android how to show gps location on google map”, please, google more thoroughly and go through tutorials before posting such simple questions 🙂

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

Sidebar

Related Questions

I am trying to create an app that will display articles from an online
I am trying to create an android app that will let me display images
I'm trying to create a C# form app that will allow me to use
I am trying to create an app that will allow me to stream video
I am trying to create an app that has a list of users and
I am trying to create a simple 3-D app for android that will have
I am trying to create an android app that will connect to various web
I'm trying to create a windows form app that will be able to handle
I'm trying to create coloumns of text for a C# app that will be
Background: I am trying to create a really simple iPhone app that will allow

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.