freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于android平臺(tái)的天氣預(yù)報(bào)短信服務(wù)系統(tǒng)課程設(shè)計(jì)-資料下載頁(yè)

2025-06-24 22:20本頁(yè)面
  

【正文】 在此顯示的巢湖地區(qū)的谷歌地圖。 :package 。import 。import 。import 。import 。import 。import 。import 。public class GoogleMapActivity extends MapActivity { /** Called when the activity is first created. */ private MapView mapView。 private MapController mapController。 private TextOverlay textOverlay。 @Override public void onCreate(Bundle savedInstanceState) { (savedInstanceState)。 setContentView()。 mapView = (MapView) findViewById()。 mapController = ()。 Double lng= * 1E6。 Double lat= * 1E6。 GeoPoint point = new GeoPoint((), ())。 (point)。 (11)。 (point)。 (false)。 (true)。 (true)。 textOverlay = new TextOverlay()。 ListOverlay overlays = ()。 (textOverlay)。 } @Override protected boolean isRouteDisplayed() { // TODO Autogenerated method stub return true。 }},其部分重要代碼如下:public class TextOverlay extends Overlay { @Override public boolean onTap(GeoPoint p, MapView mapView) { String tDescription = 。 String temp = 。 String day_of_week = 。 String city = 。 City c = new City()。 Location l = new Location()。 (())。 (())。 city = (l).toLowerCase()。 String value = (city)。 String queryString = + value + amp。u=c。 XmlPullParser parser = ()。 try { (new URL(queryString).openConnection() .getInputStream(), UTF8)。 } catch (MalformedURLException e) { // TODO Autogenerated catch block ()。 } catch (XmlPullParserException e) { // TODO Autogenerated catch block ()。 } catch (IOException e) { // TODO Autogenerated catch block ()。 } int code = 0。 try { code = ()。 } catch (XmlPullParserException e) { // TODO Autogenerated catch block ()。 } String preString = null。 while (code != ) { switch (code) { case : preString = ()。 if ((condition)) { tDescription = (0)。 temp = (2)。 day_of_week = (3)。 } break。 default: break。 } try { code = ()。 } catch (XmlPullParserException e) { // TODO Autogenerated catch block ()。 } catch (IOException e) { // TODO Autogenerated catch block ()。 } } ((), city + , + tDescription + , + temp + ℃, ).show()。 return false。 }}public class City { /** * 借助Google MAP 通過(guò)用戶當(dāng)前經(jīng)緯度 獲得用戶當(dāng)前城市 */ static final String GOOGLE_MAPS_API_KEY = 01ylSKoo1f2tLYEtKRNEXWxwj4BBunBWrN_n41A。 private String city = 全國(guó)。 public City() { } /** * 獲得城市 * * @return */ public String getCity() { return city。 } /** * 通過(guò)Google map api 解析出城市 * * @param loc * @return */ public String reverseGeocode(Location loc) { // ,amp。output=jsonamp。oe=utf8amp。sensor=true_or_falseamp。key=your_api_key String localityName = 。 HttpURLConnection connection = null。 URL serverAddress = null。 try { // build the URL using the latitude amp。 longitude you want to lookup // NOTE: I chose XML return format here but you can choose something // else serverAddress = new URL( + (() / 1E6) + , + (() / 1E6) + amp。output=xmlamp。oe=utf8amp。sensor=trueamp。key= + GOOGLE_MAPS_API_KEY)。 // set up out munications stuff connection = null。 // Set up the initial connection connection = (HttpURLConnection) ()。 (GET)。 (true)。 (10000)。 ()。 try { InputStreamReader isr = new InputStreamReader( ())。 InputSource source = new InputSource(isr)。 SAXParserFactory factory = ()。 SAXParser parser = ()。 XMLReader xr = ()。 GoogleReverseGeocodeXmlHandler handler = new GoogleReverseGeocodeXmlHandler()。 ((ContentHandler) handler)。 (source)。 localityName = ()。 (() + localityName)。 } catch (Exception ex) { ()。 } } catch (Exception ex) { ()。 (() + ex)。 } return localityName。 } public class GoogleReverseGeocodeXmlHandler extends DefaultHandler { private boolean inLocalityName = false。 private boolean finished = false。 private StringBuilder builder。 private String localityName。 public String getLocalityName() { return 。 } @Override public void characters(char[] ch, int start, int length) throws SAXException { (ch, start, length)。 if ( amp。amp。 !) { if ((ch[start] != 39。\n39。) amp。amp。 (ch[start] != 39。 39。)) { (ch, start, length)。 } } } @Override public void endElement(String uri, String localName, String name) throws SAXException { (uri, localName, name)。 if (!) { if ((LocalityName)) { = ()。 = true。 } if (builder != null) { (0)。 } } } @Override public void startDocument() throws SAXException { ()。 builder = new StringBuilder()。 } @Override public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { (uri, localName, name, attributes)。 if ((LocalityName)) { = true。 } } } public static String getCode(String name) { String result = null。 MapString, String map = new HashMapString, String()。 (chengdu, 482534)。 (changsha, 2142699)。 (dingxi, 2145619)。 (yueyang, 2142707)。 (newyork, 191501980)。 (zhuzhou, 2142708)。 (xiangtan, 4867922)。 (chaohu, 2126230)。 if ((name)) result = (name)。 return result。 }}最后為了使定義的Activity和ListActivity生效。activity android:name=.WeatherDemo android:label=@string/app_name intentfilter action android:name= / category android:name= / /intentfilter/activityactivity android:name=.WeatherActivity /activity android:name=.HistoryActivity /activity android:name=.SetupActivity /activity android:name
點(diǎn)擊復(fù)制文檔內(nèi)容
外語(yǔ)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1