google-maps-android-api-2

Android: Google Maps location with low battery usage

我与影子孤独终老i 提交于 2019-11-27 03:26:10
My app is currently using Maps by Google Play Services speficying: mMap.setMyLocationEnabled(true); I realize each time I am displaying the map in my app: the location is indicated on the map by a blue dot a location icon is displaying in the top bar if I go into Settings/Location of the phone, my app is reported as "High battery use" However, I can see there are apps that use Maps and still show the location blue dot, but the location icon doesn't appear in top bar and their battery usage is low. My app currently grants both permissions: android.permission.ACCESS_COARSE_LOCATION android

My location button event listener

て烟熏妆下的殇ゞ 提交于 2019-11-27 03:10:07
问题 I enabled the my-location layer of the Google Maps Android API v2, which adds the floating button to go to the user's current location. I need a way to detect a click on this button. Is this possible? 回答1: No, currently there is no way to get that information. There is a feature request raised for that and it is already Acknowledged by Google. Star it if you want a quicker fix: http://code.google.com/p/gmaps-api-issues/issues/detail?id=4789&q=apitype%3DAndroid2&colspec=ID%20Type%20Status

Highlight whole countries in Google Maps for Android

喜你入骨 提交于 2019-11-27 02:59:31
问题 Referring to: Highlight whole countries in Google Maps I'm trying to return the location of selected countrys by the user in the Google Maps Android application. Something like this but in Android google maps. Is there a possibility to do this in android? Is it possible to do this offline? 回答1: The question about country or other features borders in Google Maps APIs was asked many times, however, unfortunately Google doesn't expose this data publicly. To highlight the country you should apply

Google Map Android Api V2 Sample Code not working

我只是一个虾纸丫 提交于 2019-11-27 02:13:49
问题 I had tried to use the Google Map Sample Code before which was provided in Google_Play_SERVICE/SAMPLE by using all the available options and it showed the below Log. 01-14 17:58:39.773: E/Google Maps Android API(13114): Authorization failure. It showed me the blank screen for all of the sample Map options. Now I created a new Project and here is its complete code:- Activity.java public class MapActivity extends FragmentActivity { private Context context = this; @Override protected void

MapFragment or MapView getMap() returns null on Lollipop

爱⌒轻易说出口 提交于 2019-11-27 02:13:21
问题 I've been using Google Maps API v2 for a long time on Android 4.x versions without a problem. Now I installed latest Lollipop build on my Nexus devices (5 and 7) trying to materialize the app. I'd like to point out that everything is ok on KitKiat and the problem I'm describing is poping up only on Lollipop. In my XML source code I'm using MapFragment (Google Play Services library version 6.1.11). <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match

How to configure android map sdk v2 to use different keys for production and development?

回眸只為那壹抹淺笑 提交于 2019-11-27 02:12:15
问题 I want to automatically set different android map api V2 keys for development and production. 回答1: Log in to Google APIs Console Under "Simple API Access" click "Edit Allowed Android apps..." on the right side Enter one SHA-1 fingerprint per line like the instructions say: "One SHA1 certificate fingerprint and package name (separated by a semicolon) per line. Example: 45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:12:17:F2:56:26:A0:E0;com.example 45:B6:E4:6F:36:AD:1A:98:94:B4:02:66:2B:12:17:F1:56:26

Android Google Map API V2 Blank Screen

╄→гoц情女王★ 提交于 2019-11-27 02:11:36
问题 Hi I recently followed Vogella's tutorial on Google Map API v2. The code is similar to his. But for some reason the map shows up blank and the logcat shows no error either. I also followed this video to get the SHA1 finger print then I put the API key inside the manifest file. I used the debug keystore C:\Users\UserName.android\debug.keystore which is also the default debug keystore located in Eclipse -> Windows -> Preference -> Android -> Build. I also generated a new API key and it still

Displaying multiple routes using Directions API in Android

╄→尐↘猪︶ㄣ 提交于 2019-11-27 02:03:45
问题 I am using this class to display a route on a map. The problem is that it only displays one route. What I want to do is display multiple alternate routes on the map. Even thought the server response has multiple routes, it only parses the first route and displays it. What changes should I make to display all the routes that the google server returns.Here is my class. public class GMapV2Direction { public final static String MODE_DRIVING = "driving"; public final static String MODE = "walking"

zoom to fit all markers on map google maps v2

不羁的心 提交于 2019-11-27 01:42:34
问题 I want to set the map zoom level to fit all markers on the map. I have used following method as said by many people, but it is not working for me. It is displaying some other point. if (positions.size() > 0) { final LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (Marker m : positions) { builder.include(m.getPosition()); } builder.include(positions.get(i).getPosition()); } try { googleMap.setOnCameraChangeListener(new OnCameraChangeListener() { @Override public void

TileProvider method getTile - need to translate x and y to lat/long

跟風遠走 提交于 2019-11-27 01:22:02
问题 I’m porting an iOS app to Android, and using Google Maps Android API v2. The application needs to draw a heatmap overlay onto the map. So far, it looks like the best option is to use a TileOverlay and implement a custom TileProvider . In the method getTile , my method is given x, y, and zoom, and needs to return a bitmap in the form of a Tile . So far, so good. I have an array of heatmap items that I will use to draw radial gradients onto the bitmap, each with a lat/long. I am having trouble