google-maps-android-api-2

How to get location of android device by its android id

萝らか妹 提交于 2019-12-02 09:26:43
I am new in android and recently start learning about Android and I am trying to get location of any android device by its unique android id. By that I can track the approx or exact location either by GPS or network provider. In detail I mean to say that whenever i enter any Android id in my app i can get device location in my application. Thanks for your kind help. Finally I am able to do with this code: public class MyService extends Service implements LocationListener{ String GPS_FILTER = ""; Thread triggerService; LocationListener locationListener; LocationManager lm; private static final

getting latitude longitude 0.0 from googleMap.getCameraPosition().target

你说的曾经没有我的故事 提交于 2019-12-02 08:00:44
问题 I was trying to get latitude and longitude of center of the map. I am using Fragment to show map that is, SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.mapID); if (fm != null) { googleMap = fm.getMap(); } LatLng loc = googleMap.getCameraPosition().target; I am printing this loc and i am getting value as 0.0, 0.0. I am not getting where i am going wrong. I tried to use VisibleRegion also to get latitude and longitude of center of map but even

AutoCompleteTextView is not getting the suggestions from Google Places API

谁说我不能喝 提交于 2019-12-02 07:51:03
问题 This is my code to get the Places suggestions from Google Places API. But it is showing some error like "Cannot connect to Google Places API". I have given the proper error which I am getting at the bottom of this code. I just need an AutoCompleteTextView to be populated with GeoLocations. For example, if the user types in "Deh", suggestions starting from Deh should appear right away,like, "Dehradun, India" public class MainActivity extends ActionBarActivity { Button selectRoute; private

dynamic Polyline colors with google maps android app

拜拜、爱过 提交于 2019-12-02 07:20:31
问题 I'm making an app that uses google maps to show when you deviate from a path previously taken. I can show where the deviations occur with a different color, but I have to initialize a new PolyOptions(), resulting in "choppy" polylines instead of smooth polylines like I have with my base route. If I don't initialize a new PolyOptions() then when I start to deviate, it turns a large portion of the path red, even though I'm only trying to apply the color to that one particular polyline. When I

Plotting coordinates on Route in Gmap (Google Maps Android API)

假如想象 提交于 2019-12-02 07:09:20
问题 I'm currently working on one Android application using Google map. My requirement is to draw a route between source-destination and plot markers at every 500 meters on that route. I have drawn a route, but not getting how to plot markers at every 500 meters. Is there any Google API available to get coordinates on route, or I have to implement any other logic? 回答1: Objectives The objective is getting a list of LatLng coordinates along the route returned by the Directions API web service at

OnPlaceSelectedListener of SupportPlaceAutocompleteFragment not fired

☆樱花仙子☆ 提交于 2019-12-02 07:00:36
问题 I'm having a problem with the OnPlaceSelectedListener method of a SupportPlaceAutocompleteFragment . My onViewCreated() method: @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Initialise a new fragment inside of this one. mFragmentManager = getChildFragmentManager(); mSupportMapFragment = (SupportMapFragment) mFragmentManager.findFragmentByTag("mapFragment"); mSupportPlaceAutocompleteFragment =

Drag Polyline onMarkerDrag Android Google Maps v2

冷暖自知 提交于 2019-12-02 06:39:46
问题 I'm currently developing an android application that would allow users to draw Polylines with Markers on the map. Right now, I would like to implement a feature whereby the polyline will be draggable whenever the marker is being dragged and update the Polyline when the onMarkerDragEnd() method is being called. Does anyone know how I can achieve this? Below is a snippet of my codes. Thanks! googleMap.setOnMapClickListener(new OnMapClickListener(){ @Override public void onMapClick(LatLng point)

Android Google Map Utils Clustering Distance

不羁岁月 提交于 2019-12-02 06:37:43
问题 I'm using Android Google Map utils to enable clustering of my Markers. I'm using 10 Markers When I press on a button, I call: mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(getMarkerBoundingBox(), MAP_PADDING)); Eight of my markers are close to a given region so they are clustering and I can see a blue ball with the number eight on the center. The other two markers are far away from the other group but are really close to each other. I'm now seeing a cluster with the eight markers

Google Map Lite Mode moveCamera to lat lng bounds adds unwanted map padding

徘徊边缘 提交于 2019-12-02 06:15:44
问题 I want map camera to move to my LatLngBounds. So I add map fragment to layout in BaseExpandableListAdapter 's getChildView and onMapReady I'll moveCamera to LatLngBounds @Override public View getChildView(final int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { convertView = inflater.inflate(R.layout.event_child, parent, false); GoogleMapOptions options = new GoogleMapOptions(); options.liteMode(true) .compassEnabled(false) .mapToolbarEnabled

Plotting coordinates on Route in Gmap (Google Maps Android API)

前提是你 提交于 2019-12-02 06:12:30
I'm currently working on one Android application using Google map. My requirement is to draw a route between source-destination and plot markers at every 500 meters on that route. I have drawn a route, but not getting how to plot markers at every 500 meters. Is there any Google API available to get coordinates on route, or I have to implement any other logic? Objectives The objective is getting a list of LatLng coordinates along the route returned by the Directions API web service at every N meters. Later we can create markers for this list of coordinates. Solution The solution has two steps.