google-maps-android-api-2

Android Maps V2 App Crashing

馋奶兔 提交于 2019-12-12 16:44:01
问题 I have made an app that uses Google Android Maps API V2 and I have followed every step in the guide provided by Google but it doesn't work unfortunely and it crashes every time I try to start it up. So I'm wondering what is the problem? MainActivity.java package com.android.maptest; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

When asking for runtime permission for location

雨燕双飞 提交于 2019-12-12 14:23:32
问题 Currently when asking for run time permission when launching my app for the very first time it prompts the user to use their location. And if you click yes it doesn't enable location like it should. But if I relaunch the app it enables the location. Any suggestions as to where I can get it to have location enabled on first launch ? The first part of the code is called in OnCreate. if (ContextCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) !=

SupportMapFragment with a custom layout, possible?

别说谁变了你拦得住时间么 提交于 2019-12-12 11:43:20
问题 I am trying to have SupportMapFragment with a custom layout, right now the following code works : @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = super.onCreateView(inflater, container, savedInstanceState); // initMap(); return view; } But I want to change the onCreateView() method to inflate a different layout, instead of calling the super.onCreateView()

For google maps api v2, what is the limit for creating new android maps key(s) and adding applications to single key

99封情书 提交于 2019-12-12 10:24:11
问题 I have two queries regarding google maps api v2: For one google api console account and in its one project what is the maximum limit for creating new android key(s) for google maps api v2. what is the maximum limit for adding applications (SHA1 certificate fingerprint and package name (separated by a semicolon) per line) inside one key using 'Edit allowed Android apps' Currently i have scenario, where i have added around 108 application inside single maps key all are loading maps properly on

Rotating drawable via XML not working with marker on GoogleMap V2

▼魔方 西西 提交于 2019-12-12 10:09:49
问题 I would like to rotate a drawable with an xml-file , then show it on the map. I do like this. //...// mo1.position(myLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.myxmldrawable)); map.addMarker(mo1); //...// XML file: <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="180" android:toDegrees="180" android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/pin"/> If i ran the code the following

Android Google Map circle shape

社会主义新天地 提交于 2019-12-12 09:52:46
问题 I need to show google map in the circle shape like on picture below. The solution I'm using right now looks like this: <packagename.views.SquareWidthRelativeLayout android:id="@+id/map_wrapper" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:id="@+id/map_fragment" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent"/> <RelativeLayout android:id="@+id/map_button"

generating signature with SHA256withRSA rather than SHA1withRSA

╄→гoц情女王★ 提交于 2019-12-12 09:39:37
问题 I been trying to generate the sha1 key for using google maps v2 on windows7. According to google docs after running below command: keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android the output should be similar to this(https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2) Alias name: androiddebugkey Creation date: Jan 01, 2013 Entry type: PrivateKeyEntry

MapFragment causes flickering in ViewPager

会有一股神秘感。 提交于 2019-12-12 09:24:04
问题 I use a (Support)MapFragment inside a (Support)ViewPager, filled by a FragmentPagerAdapter. The ViewPager consists of three fragments, with the map fragment on the right: |x|x|map|. When I swipe to the right from the first fragment, die whole UI visibly redraws as the MapFragment is loaded and the screen flickers. Once the map is loaded for the first time swiping between screens works fine. How can I fix this? 回答1: I had the same issue with my project's (rather complex) structure:

How do I zoom in automatically to the current location in Google Maps API for Android?

六眼飞鱼酱① 提交于 2019-12-12 08:23:09
问题 I have integrated the Google Maps API in Android Studio, and it also finds the current location, but I want to increase the zoom level, so that I can view my current location more clearly and precised. How do I increase the zoom level? You can find my code below: package com.example.umar.testgoogle; import android.location.Location; import android.content.IntentSender; import android.location.Location; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android

Using an Animated Gif as Ground Overlays in G. Maps v2

守給你的承諾、 提交于 2019-12-12 08:21:34
问题 I am currently using Google Maps and would like to use an animated Gif as Overlay in my app. This is really frustrating as it seems very easy on iOS version of the app, SO I really want to achieve something cool. The result I would like to see is on 23s of this video: https://www.youtube.com/watch?v=JI323jA67x0#t=23s The Ground Overlays seems the bast practice, but doesn't accept animated gif: LatLng NEWARK = new LatLng(40.714086, -74.228697); GroundOverlayOptions newarkMap = new