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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:51:02+00:00 2026-06-15T12:51:02+00:00

In my application to set a driving path then start GPS track. the moving

  • 0

In my application to set a driving path then start GPS track. the moving location color as red. I am using google map direction api. To set a direction path is working fine. But gps tracking doesn’t work.

How to enabled gps and gps tracking path color?

Here is my code:

public class MainActivity extends MapActivity implements LocationListener {

    private static final String Location = null;
    public MapView mapView ;
    public List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();
    private LocationManager lm;
    private LogOverlay logOverlay;
    private GpsLog log;
    double lat;
    double lon;
    public GeoPoint  srcGeoPoint,destGeoPoint,interGeoPoint;

    public void onCreate(Bundle savedInstanceState) {           
    super.onCreate(savedInstanceState);   
    System.out.println("*************1**************1");
    setContentView(R.layout.activity_main);
    System.out.println("*************2**************");
    mapView = (MapView) findViewById(R.id.mapv); 
    mapView.setBuiltInZoomControls(true);
    System.out.println("*************3**************");
    lm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 20000, 10,this);                           
    double src_lat = 12.98472; // the testing source 
    double src_long = 80.17778; 
    double dest_lat = 13.00833; // the testing destination 
    double dest_long =80.2125;         
    double via_lat = 13.065; // the testing destination 
    double via_long = 80.2325;
    srcGeoPoint = new GeoPoint((int) (src_lat * 1E6), 
    (int) (src_long * 1E6)); 
    destGeoPoint = new GeoPoint((int) (dest_lat * 1E6), 
    (int) (dest_long * 1E6)); 

    interGeoPoint = new GeoPoint((int) ( via_lat * 1E6), 
          (int) (via_long * 1E6));               
    mapView.getController().animateTo(srcGeoPoint);
    mapView.getController().setZoom(15);
    new LongOperation().execute("");       
    initMyLocation();  
    final MyLocationOverlay overlay = new MyLocationOverlay(this, mapView);
    overlay.enableMyLocation();
    overlay.enableCompass();
    mapView.invalidate();
    System.out.println("*************4**************");
}

private void initMyLocation() {
    System.out.println("init my location *************");
    // does not work in emulator                 
}
  • 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-06-15T12:51:04+00:00Added an answer on June 15, 2026 at 12:51 pm

    Hi Add check this missing code snippet

    // Adding current location on map view
    
    private void addMyLocationOverlay() {
        myLocation = new MyLocationOverlay(this, mapView);
        mapView.getOverlays().add(myLocation);
    
        myLocation.enableMyLocation();
    
        myLocation.runOnFirstFix(new Runnable() {
            @Override
            public void run() {
                mapController.animateTo(myLocation.getMyLocation());
            }
        });
    
    }
    

    This code will show current location animated blue white blinking dot on mapview

    No Need to use location manager & calling requestLocationUpdates

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

Sidebar

Related Questions

I need my application installer set the program to auto-startup for all users. Then
Using Jetty 7.0.2, I am unable to set a custom session cookie path. I
I have a django application set up using mainly the admin interface with a
I have Silverlight application set in Sharepoint webpart. The application modifies Sharepoint lists using
- (void) applicationDidFinishLaunching:(UIApplication *)application { //set up main loop [NSTimer scheduledTimerWithTimeInterval:0.033 target:self selector:@selector(gameLoop:) userInfo:nil
So I have a XNA application set up. The camera is in first person
This does NOT work: Sub X() Dim A As Access.Application Set A = CreateObject(Access.Application)
I have the update frequency of my ClickOnce application set to weekly. What is
Can the application use set same char in the XON and XOFF? If yes,
We have Tomcat application server set up at port 8080 and Apache Http Server

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.