예배 규칙서 찾다
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
문자


Geocoder

版本:Android 4.0 r1

结构

继承关系

public final classGeocoderextendsObject

java.lang.Object

android.location.Geocoder

类概述

一个处理前向地理编码和反向地理编码的类。地理编码是一个街道、地址或者其他位置(经度、纬度)转化为坐标的过程。反向地理编码是将坐标转换为地址(经度、纬度)的过程。一组反向地理编码结果间可能会有所差异。例如:一个结果可能包含最临近建筑的完整街道地址,而另一个可能只包含城市名称和邮政编码。Geocoder要求的后端服务并没有包含在基本的Android框架中。如果没有此后端服务,执行Geocoder的查询方法将返回一个空列表。使用isPresent()方法,以确定Geocoder是否能够正常执行。

公共构造器

publicGeocoder(Context context, Local local)

根据给定的语言环境构造一个Geocoder对象。

参数

context当前的上下文对象。

local the当前语言环境

publicGeocoder(Context context)

根据给定的系统默认语言环境构造一个Geocoder对象。

参数

context当前的上下文对象。

公共方法

public List

getFromLocation(double latitude, double longitude, int maxResults)

根据给定的经纬度返回一个描述此区域的地址数组。返回的地址将根据构造器提供的语言环境进行本地化。

返回值有可能是通过网络获取。返回结果是一个最好的估计值,但不能保证其完全正确。

参数

latitude纬度

longitude经度

maxResults要返回的最大结果数,推荐1~5

返回值

一组地址对象。如果没找到匹配项,或者后台服务无效的话则返回null或者空序列。

异常

IllegalArgumentException纬度小于-90或者大于90

IllegalArgumentException果经度小于-180或者大于180

IOException如果没有网络或者IO错误

public List

getFromLocationName(String locationName, int maxResults, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude)

返回一个由给定的位置名称参数所描述的地址数组。名称参数可以是一个位置名称,如:“Dalvik, Iceland”,一个地址,如:“1600 Amphitheatre Parkway, Mountain View, CA”,一个机场代号,如:“SFO”,等等……返回的地址将根据构造器提供的语言环境进行本地化。

你也可以指定一个搜索边界框,该边界框由左下方坐标经纬度和右上方坐标经纬度确定。

返回值有可能是通过网络获取。返回结果是一个最好的估计值,但不能保证其完全正确。通过UI主线程的后台线程来调用这个方法可能更加有用。

参数

locationName用户提供的位置描述

maxResults要返回的最大结果数,推荐1~5

lowerLeftLatitude左下角纬度,用来设定矩形范围

lowerLeftLongitude左下角经度,用来设定矩形范围

upperRightLatitude右上角纬度,用来设定矩形范围

upperRightLongitude右上角经度,用来设定矩形范围

返回值

一组地址对象。如果没找到匹配项,或者后台服务无效的话则返回null或者空序列。

异常

IllegalArgumentException如果位置描述为空

IllegalArgumentException如果纬度小于-90或者大于90

IllegalArgumentException如果经度小于-180或者大于180

IOException如果没有网络或者IO错误

public List

getFromLocationName(String locationName, int maxResults)

返回一个由给定的位置名称参数所描述的地址数组。名称参数可以是一个位置名称,如:“Dalvik, Iceland”,一个地址,如:“1600 Amphitheatre Parkway, Mountain View, CA”,一个机场代号,如:“SFO”,等等……返回的地址将根据构造器提供的语言环境进行本地化。

返回值有可能是通过网络获取。返回结果是一个最好的估计值,但不能保证其完全正确。

通过UI主线程的后台线程来调用这个方法可能更加有用。

参数

locationName用户提供的位置描述

maxResults要返回的最大结果数,推荐1~5.

返回值

一组地址对象。如果没找到匹配项,或者后台服务无效的话则返回null或者空序列。

异常

IllegalArgumentException如果位置描述为空

IOException如果没有网络或者IO错误

public static booleanisPresent()

如果GeocodergetFromLocationgetFromLcationName都实现了则返回true,没有网络连接这些方法仍然可能返回空或者空序列。

补充

文章精选

Android地图开发中的地理编码与地理反编码

Android地图和定位学习总结


이전 기사: 다음 기사: