google-maps-android-api-2

show google maps in android v2 app crashes on open activity, inflate exception binary file number #2

倖福魔咒の 提交于 2020-01-15 15:25:29
问题 I am trying to open google maps to show some locations. I am following http://mobisys.in/blog/2012/12/google-rolls-out-android-maps-api-v2/ link for this, but its not opening maps its crashing and says inflate exception binary file number #2, i have checked in manifest meta data is fine, fragment is case sensitive, key is correct , here it is my stack trace : 02-26 18:15:25.648: I/System.out(5029): img button cust.>> 02-26 18:15:25.718: D/AndroidRuntime(5029): Shutting down VM 02-26 18:15:25

Android Maps GPS outlier

╄→尐↘猪︶ㄣ 提交于 2020-01-15 11:28:08
问题 Using the Android maps api I'm creating polygons as I collect location data from every third point. The polygons track my position fairly well. Problem is: Frequently the GPS returns points that are not remotely close especially when working around obstacles. How can I filter my location data for outliers? 回答1: Yes GPS has a hard time with especially around obstacles. Powerlines, buildings, etc. Simply filter them out. @Override public void onLocationChanged(Location location) { if (!location

Android Maps GPS outlier

无人久伴 提交于 2020-01-15 11:28:06
问题 Using the Android maps api I'm creating polygons as I collect location data from every third point. The polygons track my position fairly well. Problem is: Frequently the GPS returns points that are not remotely close especially when working around obstacles. How can I filter my location data for outliers? 回答1: Yes GPS has a hard time with especially around obstacles. Powerlines, buildings, etc. Simply filter them out. @Override public void onLocationChanged(Location location) { if (!location

Google Map API making lines smoother when bending

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 14:13:42
问题 I am using Google Map API to get lines on the map in my application. I am loading the nodes of the lines from a database using following code: // Add polyline "walks voda" List<WalkLine> dbwalknodes = dbclass.queryWalksFromDatabase(this); // list of latlng for (int i = 0; i < dbwalknodes.size() - 1 ; i++) { WalkLine source = dbwalknodes.get(i); WalkLine destination = dbwalknodes.get(i+1); Polyline line = mMap.addPolyline(new PolylineOptions() .add(new LatLng(source.getLat(), source.getLon()),

Google Map API making lines smoother when bending

孤街醉人 提交于 2020-01-14 14:12:00
问题 I am using Google Map API to get lines on the map in my application. I am loading the nodes of the lines from a database using following code: // Add polyline "walks voda" List<WalkLine> dbwalknodes = dbclass.queryWalksFromDatabase(this); // list of latlng for (int i = 0; i < dbwalknodes.size() - 1 ; i++) { WalkLine source = dbwalknodes.get(i); WalkLine destination = dbwalknodes.get(i+1); Polyline line = mMap.addPolyline(new PolylineOptions() .add(new LatLng(source.getLat(), source.getLon()),

SupportMapFragment on DialogFragment

岁酱吖の 提交于 2020-01-14 13:51:12
问题 I need to embed a SupportMapFragment in a Dialog . This is the best I could think of: public class SupportMapFragmentDialog extends DialogFragment { private final SupportMapFragment fragment; public SupportMapFragmentDialog() { fragment = new SupportMapFragment(); setTargetFragment(fragment, 1); } @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { return fragment.onCreateView(inflater, container, savedInstanceState);

How do I let the user choose a location in Google Maps and return the chosen point to my App Inventor application?

六眼飞鱼酱① 提交于 2020-01-14 10:44:17
问题 I am developing an app using App Inventor. It includes the need for a user to press a button - to save a location when they are at the location. But every time this is not practical. So I want to implement a method in my App Inventor app which will: -Open Google Maps -Let the user select any point on the map with no additional info. -After choosing, return to the app and return latitude, longitude values for the location that is selected. This is really important for me, help will be

How to customise the state_pressed colour of an infowindow in Google Maps?

流过昼夜 提交于 2020-01-14 10:44:07
问题 I am trying to customise the state_pressed behaviour of an InfoWindow in Google Maps. Normally when this InfoWindow is pressed, it turns yellow. That's also the case with custom InfoWindows. But I want to change this to another colour, like red or orange or blue. So I created a very simple custom InfoWindow like this: class MyInfoWindowAdapter implements InfoWindowAdapter { private final View myContentsView; MyInfoWindowAdapter() { myContentsView = getLayoutInflater().inflate(R.layout.popup,

Android marker custom infowindow

孤街醉人 提交于 2020-01-13 18:38:30
问题 I am using Google Map V2. I need to show the ListView (custom ListView with Image) in custom InfoWindow . I tried it and got success only in View , the problem is I can't get the listItemClick event. googleMap.setInfoWindowAdapter(new InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { // TODO Auto-generated method stub return null; } @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.infowindow, null); try{ String[] names =

Move camera position to fit LatLngBounds with regard to marker height

会有一股神秘感。 提交于 2020-01-13 10:29:07
问题 I want to move camera to position to fit LatLngBounds with regard to marker height. So far I'm able for fit the anchors of markers with this code: LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (Marker marker : markerList) { builder.include(marker.getPosition()); } LatLngBounds bounds = builder.build(); int padding = getActivity().getResources().getDimensionPixelSize(R.dimen.home_map_padding); // offset from edges of the map in pixels cameraUpdate = CameraUpdateFactory