android-maps

How to show route on Inbuilt Map in Android Programmatically

那年仲夏 提交于 2019-12-23 06:32:32
问题 After Full day Spending, I Found solution of this Question: How to show route on InBuilt MAP from one current place to another place using longitude/latitude or using Address? May it is helpful to you. 回答1: Create layout file for Button: layout.xml <Button android:id="@+id/showMap" android:layout_width="@dimen/visit_button_width" android:layout_height="wrap_content" android:layout_marginTop="25dp" android:background="@drawable/login_button_selector" android:text="@string/title_show_map"

Mark current location on google map

旧街凉风 提交于 2019-12-22 11:28:46
问题 How to mark my current location on google map? I am using google place API. I have to show all near places from my current position. All places are showing on google map, but how to show my current position? The code is given below: public class PoliceStationMapActivity extends FragmentActivity implements LocationListener { private ArrayList<Place> mArrayListPoliceStations; private GoogleMap mMap; private LocationManager locManager; private double latitude; private double longitude; @Override

Google Maps v2 Error on use of setMyLocationEnabled

我是研究僧i 提交于 2019-12-21 22:04:15
问题 I am not sure were I went wrong, getting a nullPointerException on using googlemap.setMyLocationEnabled(true) in Google Map v2 example. MainActivity.java File: package com.example.locationgooglemapsv2; import java.io.IOException; import java.util.List; import android.content.Context; import android.location.Address; import android.location.Criteria; import android.location.Geocoder; import android.location.Location; import android.location.LocationListener; import android.location

android - Geocoder.getFromLocationName() is not working in ICS device

ε祈祈猫儿з 提交于 2019-12-21 07:38:58
问题 I have two devices. One is HTC WildFire S and other one is HTC 1V . I used the Geocoder.getFromLocationName() in my application. It is running successfully in the HTC wildfire S . But in the HTC 1V i got the following error. why it's came? How can i solve this? please can anybody help me. Code Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); //s is the address List<Address> addresses = geoCoder.getFromLocationName(s, 5); //Here i got the following Exception. Error 06

How do I draw a KML file on a MapView in Android?

你。 提交于 2019-12-20 03:02:47
问题 I have to draw a KML file into a MapView. I looked in the internet but I didn't find an example how to do it, if someone can give an example how to do it it wil be great! 回答1: KML is not supported now. You can draw trace like that w/o KML : 1) Make request to Google service : Request : http://maps.googleapis.com/maps/api/directions/output?parameters Info about : https://developers.google.com/maps/documentation/directions/ 2) Send request 3) Parsing JSON response like this : JSONObject

Can GeoCoder getFromLocation method cause a NetworkOnMainThreadException to be thrown?

半世苍凉 提交于 2019-12-20 03:00:12
问题 I have an app which was tested thoroughly and working fine on Android Gingerbread (and older Android versions). I've noticed from users' reported crash errors that phones running later versions of the Android operating system are throwing a NetworkOnMainThreadException . I'm trying to work through my code and eliminate/fix all culprits. Would the GeoCoder getFromLocation and getFromLocationName methods throw a NetworkOnMainThreadException if called from the main/ui thread? 回答1: Seems like

Saving MapFragment (Maps v2) State in Android

夙愿已清 提交于 2019-12-19 12:37:08
问题 I'm working with the new GoogleMaps API (v2) and have some problems with the fragment. I have two fragments in my app (Map, List) and the user can switch between them. Works fine so far with this code: if (itemPosition == 0) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myMapFragment).commit(); } else if (itemPosition == 1) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myListFragment).commit(); }...... When I work with the map,

Can I use AnimationDrawable in an overlay on a MapView?

只愿长相守 提交于 2019-12-18 13:29:27
问题 I have created an AnimationDrawable in XML, and it works fine. But on moving the drawable into a MapView as an overlay marker (replacing a static drawable that works fine), the animation stubbornly refuses to play. I've moved the call to start() to a button, for testing, and even when pressed several seconds after the MapView has displayed, the animation doesn't start. I'm seeing nothing in logcat. I know start() needs calling after all the windows are set up, but this seems to be a separate

Embedded Google Map can't get current location in WebView

我们两清 提交于 2019-12-18 05:01:32
问题 I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on

Embedded Google Map can't get current location in WebView

时间秒杀一切 提交于 2019-12-18 05:01:10
问题 I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on