Implement navigation feature in android Google maps

I'm trying to implement navigation feature for my map activity in android.

I want it like how it is done in ola app. Marker should move along the poly line dynamically detecting the change in device's location.

my code:

private void setUpMap() { MapHelper mapHelper = new MapHelper(mMap); ArrayList<Marker> markers = new ArrayList<Marker>(); Marker origin = mMap.addMarker(new MarkerOptions().position(sourceCoordinates). title("You are here"). icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))); Marker destination = mMap.addMarker(new MarkerOptions().position(destinationCoordinates). title("your destination"). icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED))); markers.add(origin); markers.add(destination); mapHelper.zoomToFitMarkers(markers.toArray(new Marker[markers.size()])); mapHelper.drawRoutePath(WalkingDirectionsOnMap.this, sourceCoordinates, destinationCoordinates, false, Color.BLUE); }

Category:android Views:15 Time:2017-06-27

Related post

  • Android google maps APIs get directions programming 2011-07-10

    I am new to Android google maps APIs. I am learning it from this TUT : but there isn't any mention of getting the direction between 2 points. Is there any APIs can do this task in http:/

  • Android Google Maps talking to Google Maps Enterprise Data? 2011-03-28

    Is it possible to switch the Android Google Maps code to utilize custom data provided by a Google Enterprise? Details: Google provides an "enterprise" version of its maps service, where you can host your own data. See here:

  • Android google map not showing up on emulator 2011-07-20

    I am trying to implement this example and i have followed exactly all the steps but in the emulator the map doesnt show up it just displays boxes.Does any one have any idea what w

  • Android Google Maps Failed to find style 'mapViewStyle' in current theme 2011-08-07

    When adding a google map view (I extended a MapView, used the xml editor to add it to the Activity, and added my google maps api key to the layout xml file manually) My permissions allow Internet in the manifest file What i'm wondering, is in the xml

  • Android Google Map API Not provides Any Classes/Methods to manage maps tiles 2011-12-14

    In google Map API Documentation they wrote : Tiles are cached on the filesystem in your application's directory. The cache is auto-managed so you don't need to do anything with it, and can delete it at any time. Here i want to know Technical Reasons

  • Android Google maps app vs using Android WebView to view Google maps embedded in webpage 2012-02-20

    I'm working on an Android app that needs to be able to display information on Google maps. I'm considering two ways of implementing this: Use the Google maps api provided for android with the MapActivity class Or I could use the javascript google map

  • Android Google maps api vs JavaScript Google maps api 2012-04-05

    What would be the advantages/disadvantages of including Google maps in an android app, using the actual Android Google maps api as opposed to using the JavaScript Google maps api inside a WebView ? --------------Solutions------------- MapView inside

  • Android - Google Maps add overlays 2011-04-06

    I am facing a problem of adding overlays. I want to add button which will toggle between normal and satelitte view, and some textView, which will display my actual coordinates and those will be updated on my location change. I tried to put there clas

  • android google map view 2011-05-05

    i am using android Google map, the map is displayed in emulator but not in the device.. can any one help me to solve the problem. --------------Solutions------------- I think you have used the debug key(for generating the unique key). Try to use rele

  • Android google map accuracy issue 2011-05-19

    I am developing android version of an iPhone application. But, I found that in android, google map takes latitude E6 and longitude E6 integer values as GeoPoint argument. As a result, whenever I have a lat/long value like 35.1234567 it means that the

  • Android Google map routing help 2011-09-05

    I am developing a Android Google map app using Google 2.3 API. I googled around and tried this But while testing the application i got exception. Here's is the full stack-trace FATAL EXCEPTION: main 09-05 16:16:05.914: ERROR/AndroidRuntime(405): java

  • Android google maps groundoverlay 2011-09-29

    In the google maps javascript api you can add a groundoverlay and just pass two points, the point lefttoplat&lefttoplong and the point rightbottomlat&rightbottomlong... (The normal overlays don't stay between these two points, but stay the sa

  • How to disable discrete zoom level in android google maps? 2011-11-21

    Android google maps sdk approximate zoom level to discrete values. I mean that i cannot set it to 13.33 it will convert it to 13. However Google Android Maps application doesn't do it. How they achieved that? --------------Solutions------------- you

  • Android google map landforms 2012-02-26

    I've been succeded to import google maps on an android application. My question is, how can I import map with landforms? For exemple, mountain, rivers, plains, hills. I did only for street. thx! --------------Solutions------------- I'm not sure if Go

  • Parse XML file to add multiple marker on Android Google Map Application 2012-03-31

    I have a problem in using XML parse for add multiple marker in android map application this my XML file <PA> <node> <id>1</id> <nama>SMP 8 Cimahi</nama> <longitude>-6.905424</longitude> <latitude>

  • Android - Google Maps doesn't display within my application except in debugging mode 2014-05-26

    The issue I am having is one that is mirrored in many other threads with one minor difference. I am getting this screen whenever I install the apk file received via export a signed application: I have followed every one of the following stackoverflow

  • How do I implement an application similar to google maps on android? 2009-09-18

    I have a couple of images on available to my program. They are parts of jigsaw puzzle (with rectangular pieces though). I wanted the look and feel similar to that of google maps in android. One way I could implement was to create a set of ImageViews

  • Android Google Maps API Frozen Screen 2011-06-05

    I am trying to make a simple app that utilizes the Google Map API. I followed all the steps on the guides to get the map to generate but when it loads in the emulator it seems frozen and is not navigable. It also does not respond to any further contr

  • augmented reality in android google maps 2012-03-30

    Sample app which implements google maps for getting overlays at particular lat/lng.I would like to implement Augmented reality feature to the current app.can you tell me how to achieve it? Is there any tutorial or video for the same ,I looked into Mi

  • Propagate events in several layers android google maps 2009-11-30

    I'm developing a google maps based application for android 1.6. My problem is that in my application I have more than one layer that extends from ItemizedOverlay representing information in the map. The problem is that all the layers implement the on

  • Provide directions on an Android Google-Maps activity 2010-08-26

    is it possible to provide directions on a map on Android from 1 place (e.g a specific lat/lng) to another specific lat/lng? I realise this is doable with the Google-maps API but can you do it within Androids native implementation? --------------Solut

  • android google map marker 2010-12-09

    i have several markers on the google map displayed in android, i wish to display more information (information such as - some text,a picture) when a particular marker is clicked. could some one please guide me how can i go about implementing that. --

  • Android/Google Maps API: Exception data: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor 2011-02-19

    I'm building an application which relies on the Google Maps API, but running into some problems when I subclass MapView. The reason I'm trying to subclass MapView is that I want to detect and use double taps and long presses on the map to perform som

  • Android - Google Maps additional fields and buttons 2011-04-05

    I have successfully implemented diplaying of Google Maps in my application. When Android phone gets GPS signal, actual position is blinking but still I am on the whole map. I am having Google Map diplayed by: public class map extends MapActivity{ Map

Copyright (C), All Rights Reserved.

processed in 0.085 (s). 11 q(s)