Android:current location - android

I've got an activity which when started on my android device overlays a small circle on the map view indicating where i am.
This is done using mylocationoverlay.
I want to know if there is any way to get the location details from mylocationoverlay.

Its very easy .
You can obtain your current location lattitude and longitude by the following code
Double lattitude = (double)(mMyLocationOverlay.getMyLocation().getLatitudeE6()/1E6);
Double longitude = (double)(mMyLocationOverlay.getMyLocation().getLongitudeE6()/1E6);
Hope it helps :)

http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MyLocationOverlay.html#getMyLocation%28%29
check the above link.. it might will help

Related

get google maps data with retrofit 2

I try to get the distance between two points by showing them together with a polyline. One marker is permanently somewhere and the other the user chooses the place they want when clicking on the map. I tried with many codes obtained from the Internet but for me neither works or just gives me the marker of a place with the latutude and longitude. I want to use retrofit 2 to bring the information. Can anyone help me with that?
On clicking on map you are placing marker, So if you want to get location of that marker then simply you can got that marker position using that marker object like this.
Double latitude = marker.getPosition().latitude;
Double longitude = marker.getPosition.longitude;
and you have already one location so you can find distance between two locations using this.
locationFrom.distanceTo(locationDestination);
here locationFrom is your source location from where you want to find distance and locationDestination is your destination location to where you find distance.

How to mark evey next 100 meter travelled in map in android?

I am trying to get the GPS location co-ordinates(lat and lon vals) for every 100metrs.
For example, I am at particular location A and tried to fetch my current location using
location listener and shown in the map with marker, after that I have travelled 100metres and reached location B and again i tried to fetch location and shown in map with marker.
Good thing :-
i am getting but obvious new lat and lon cordinates for every next 100 meters.
Annoying Thing:-
Marker for location A and for location B getting overlapped always, so one cannot make out any sort of difference in between those two locations by dirrectly looking into map :(. How can I overcome this issue. Can you please guide me.?

how to share google map with current location in android?

I am trying to share google map with my current location in my app(similar to whatsapp), I searched for it but didn't find any solution. Can anybody guide me that how can I start working over it. I don't have any idea that how should I start this.
We need to know how you plan to share this data, but in general you can share your GeoPoint variable that contains your latitude and longitude position on the globe..
GeoPoint(int latitudeE6, int longitudeE6)
// Constructs a GeoPoint with the given latitude and longitude, measured in microdegrees (degrees * 1E6).

How can I draw a path from my location to another location?

How can i draw a route between my location and another location without using the google navigation?
I found the answer use this http://asmncl.blogspot.in/2012/04/android-draw-route-map-between-two.html with the location manager to get the lat & long of your current position

Dispalying route travelled using latitude and longitude values in map

I have an android app which will continuously send location information to server (latitude and longitude values). Another application will retrieve these info and display it in textview.
What I need to do is in my second app which displays in text view I need to add a mapview which displays the location tarvelled by marking it on map using the latitude and longitude values.
How to do it ? Thanks in advance !
As you have fetched the location information, now you just need to mark points on the map view to show the desired location on map view, You should follow using google maps android
Here you will find a good example on how to add markers on mapview.

Categories

Resources