google-maps-android-api-2

MapFragment Google Maps API v2 Out of Memory Error / Memory Leak

六月ゝ 毕业季﹏ 提交于 2019-12-18 16:57:46
问题 I've read a number of similar posts over the past few days, but none that specifically answer this problem. I start getting an OOM issue after ~2 minutes of aggressive map panning and zooming with the Hybrid map. The app also seems to hold onto the memory after the crash because it takes less time to reach OOM after the first failure. I scaled down the code to just an Activity with a MapFragment and still get the same OOM. I've used DDMS and MAT to try and isolate the problem, in addition to

how to draw text in default marker of google map v2

别等时光非礼了梦想. 提交于 2019-12-18 15:51:06
问题 I want to draw text in default marker of Google map v2. I have done this by taking my own image from drawable but how can i change it in default marker. my code is marker.icon(BitmapDescriptorFactory .fromBitmap(drawTextToBitmap(getApplicationContext(), R.drawable.images,"5"))); and drawTextToBitmap methods is. public static Bitmap drawTextToBitmap(Context gContext,int gResId,String gText) { Resources resources = gContext.getResources(); float scale = resources.getDisplayMetrics().density;

how to draw text in default marker of google map v2

一笑奈何 提交于 2019-12-18 15:49:57
问题 I want to draw text in default marker of Google map v2. I have done this by taking my own image from drawable but how can i change it in default marker. my code is marker.icon(BitmapDescriptorFactory .fromBitmap(drawTextToBitmap(getApplicationContext(), R.drawable.images,"5"))); and drawTextToBitmap methods is. public static Bitmap drawTextToBitmap(Context gContext,int gResId,String gText) { Resources resources = gContext.getResources(); float scale = resources.getDisplayMetrics().density;

Fused Location Provider in Android

假装没事ソ 提交于 2019-12-18 13:16:11
问题 I am developing an app using Fused Location Provider. I have a doubt. For getting location in regular intervals it uses requestLocationUpdates(). But from which source is it get the location either from WIFI or GPS or Network. In my app, it gets location in regular intervals only when WiFi is ON. When WiFi is in OFF state, then it can't get the location(it supposed to get location from some other source either form GPS or Network. But it never get location. Or i have to write listeners for

What is the suggested way of implementing overlays in v2 of the Android Google Maps API?

故事扮演 提交于 2019-12-18 13:14:11
问题 In the original version of the Android Google Maps API it was very easy to implement an overlay with the following code: List<Overlay> mapOverlays = mapView.getOverlays(); AlarmOverlay alarmOverlay = new AlarmOverlay(); mapOverlays.add(alarmOverlay); ...it was then possible to override the overlays draw() method and paint vector graphics, override the overlays onTouchEvent() method and give custom controls, etc. I am at a loss as to how to architect similar custom controls in v2, as the use

Arrow Mark over Polyline in Android Google Route Map

倾然丶 夕夏残阳落幕 提交于 2019-12-18 12:43:30
问题 how to show Arrowheads over Polyline in Android Google map v2 I have gone through couple of links , most of them gives link to JS https://google-developers.appspot.com/maps/documentation/javascript/examples/overlay-symbol-arrow but I need in Android not JS and I can't use those codes in Android Some are using MapActivity I followed a tutorial to creat map activity too https://developers.google.com/maps/documentation/android/v1/hello-mapview but it didnt work I can't generate the mapactivity

Using an xml Layout for a Google Map Marker for Android

被刻印的时光 ゝ 提交于 2019-12-18 12:38:25
问题 I want to use a layout and not a drawable for my marker I am using with Google Maps Api 2 for an Android app. Like this: Marker m = googleMap .addMarker(new MarkerOptions() .position(LOC) .snippet(user) .title(name) .icon(BitmapDescriptorFactory.fromResource(R.layout.map_marker))); However, it seems this is only designed for use from drawable folder. I simply what an image with a background where I can change colors based on marker type. This is the layout I want to use: <LinearLayout xmlns

How to enable “Google Maps Android API v2” in developers console

北城以北 提交于 2019-12-18 12:27:36
问题 I have developed an application to display my location on google map. When I run the program, its showing the below error. But I couldn't find a way to enable "Google Maps Android API v2". I have found a question on the same. I am not quiet clear on how to follow that step. Could you please help me solve this? 回答1: In the developer console go to API Manager Fist you will need some some API Keys. Go to Credentials. Select Create credentials and choose "API key" and "Android key". In the next

Google Map API v2 is not showing Map on device

∥☆過路亽.° 提交于 2019-12-18 12:09:36
问题 I am running sample code that is provided on Google Map Documentation for Google Map Api v2 (https://developers.google.com/maps/documentation/android/start#specify_settings_in_the_application_manifest). The code run successfully but Map is not loaded on the device. Only white screen is shown on the device. I am using 4.0.3 version Android device. 1) I enabled service for the project. 2) Generated key: 3) "google-play-services_lib" as Library in project: 4) Android Manifest: <?xml version="1.0

Google Map API v2 is not showing Map on device

ε祈祈猫儿з 提交于 2019-12-18 12:09:09
问题 I am running sample code that is provided on Google Map Documentation for Google Map Api v2 (https://developers.google.com/maps/documentation/android/start#specify_settings_in_the_application_manifest). The code run successfully but Map is not loaded on the device. Only white screen is shown on the device. I am using 4.0.3 version Android device. 1) I enabled service for the project. 2) Generated key: 3) "google-play-services_lib" as Library in project: 4) Android Manifest: <?xml version="1.0