草庐IT

Addresses

全部标签

android - 谷歌地图 : how to get address in android

当我点击特定地址时,如何从谷歌地图中获取位置或地址。是否可以使用map叠加层从mapView中收集地址。 最佳答案 请使用以下代码获取地址。try{Geocodergeo=newGeocoder(youractivityclassname.this.getApplicationContext(),Locale.getDefault());Listaddresses=geo.getFromLocation(latitude,longitude,1);if(addresses.isEmpty()){yourtextfieldname.s

Android Lollipop EditText : AutoComplete Not Working For Email Addresses

我在注册fragment中有一堆EditTexts。在KitKat及以下版本中,任何inputType为电子邮件地址的EditText都会使用系统的自动完成功能,方便用户输入电子邮件地址。但是,在Lollipop上(Nexus4上的5.0.1,就其值(value)而言),它拒绝使用自动完成功能。这是我设置输入类型的代码:mEditText.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS|InputType.TYPE_TEXT_FLAG_AUTO_CORRECT));以下

Android getFromLocationName 返回边界框外的结果

我正在通过我的Android应用进行位置搜索。用户输入地址,我使用以下代码进行查找,privatevoiddoSearch(Stringquery){FNMApplication.logInfo("Searching:"+query);//createageocoderGeocodergc=newGeocoder(this,Locale.getDefault());try{//lookuplocationswhichmatchthequeryinputbytheuserListaddresses=gc.getFromLocationName(query,5,-44.00,111.00,

android - Geocoder getFromLocation() 不为空但大小始终为 0

我正在尝试使用GoogleAPIv2检索我的位置地址。这是我的做法:Geocodergeocoder=newGeocoder(this,Locale.getDefault());Listaddresses=null;StringaddressText="";try{while(addresses==null){addresses=geocoder.getFromLocation(userLocation.latitude,userLocation.longitude,1);}if(addresses!=null&&addresses.size()>0){Addressaddress=a

android获取当前位置名称

我想用名称获取当前位置。我编写了获取当前位置(lat,lang)的代码,如何显示相对地名?(ie)13.006389-80.2575:阿迪亚尔,钦奈,印度LocationManagerlocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,newLocationListener(){publicvoidonStatusChanged(Stringpr

LeetCode93. Restore IP Addresses

文章目录一、题目二、题解一、题目AvalidIPaddressconsistsofexactlyfourintegersseparatedbysingledots.Eachintegerisbetween0and255(inclusive)andcannothaveleadingzeros.Forexample,“0.1.2.201”and“192.168.1.1”arevalidIPaddresses,but“0.011.255.245”,“192.168.1.312”and“192.168@1.1”areinvalidIPaddresses.Givenastringscontainingo

android - 验证 Android 中的地址输入

在我的应用中,我必须输入一个用户地址(美国)。用户需要输入一个有效的地址。我怎样才能做到这一点?有没有图书馆可以帮助我了解州名、城市名和街道名?如果可能的话,我想使用自动打字。我阅读了GeoCoding,但我认为它对我没有帮助,因为用户没有从当前位置输入地址。 最佳答案 这就是我使用GoogleAPI查找位置的方法。也许它会对你有所帮助:GeocodergeoCoder=newGeocoder(context,Locale.getDefault());try{Listaddresses=geoCoder.getFromLocatio

android - 如何从地点选择器的地址获取国家,城市?

我正在使用地点选择器的Intent来获取地点。现在我想将地址以国家、城市、密码、州的形式保存。我怎样才能从地点选择器的地址得到所有这些?代码:publicclassNameOfBusinessFragmentextendsFragment{intPLACE_PICKER_REQUEST=1;intRESULT_OK=-1;PlacePicker.IntentBuilderbuilder=newPlacePicker.IntentBuilder();EditTextcategory,location;@OverridepublicViewonCreateView(LayoutInflat

android - 地理编码器返回长度为零的地址

Geocoder直到今天都运行良好。它开始返回长度为0的字符串。注意:这不是Geocoder线程的副本,我在启动线程之前使用intentservice和AsyncTask获取它(AsyncTask方法在8个月内运行良好),已检查thiscode和新code来自谷歌的FusedLocationProviderClient(这是官方代码)它还返回长度为零的字符串。Thislink来自Android官方页面显示了如何通过Intent服务获取它。我在Android5.1上获得完整地址,但在Android7.1上它返回一个长度为零的地址。直到今天,我一直在使用并且运行良好的代码。privatev

Android onLocationChanged location.getTime() 返回错误的时间

我有一个SamsungGalaxyTabA。我已经实现了android.location.LocationListener并且onLocationChanged(Locationlocation)被调用,它给了我一个正确的经度和纬度但是,问题是:location.getTime()给了我错误的时间,它返回的时间接近300000百万左右。它应该类似于1471243684497。我不知道该怎么办。GPSTracker类:​​importjava.io.IOException;importjava.util.List;importjava.util.Locale;importandroid.