Info

return super.onOptionsItemSelected(item); }

• P fti-gsinIff B iilf&ftl/S, mr>ffi& Activity w intentO, #EI.i£'ff. f Action ill data, J& W tift# frfP.f¥M ActivityDiaryEditor ijo

• r -tW/ Activity m intent, ^llfegs. r Action fll data o Nit, ActivityDiaryEditor JS&fflSfl. ffi' 3? ft fitftJ J6. 1H item.getlntent().getData()i#iiJ 7 ffrffi SM Uri 0

• S HJ 'T1- itr ffil fifc $ ill ^ , ft! I f iffl ii ContentUris.withAppendedld(getlntent().getData(), getListView{).getSeIectedIteinId())5fe^#iJ;f #MI$jttligffiJ Uri, ^miW ContentResolvor, $ JfT^ffl'tLiW delete ^¿iittrfflfto

• WI&ftftS/Fi. tfflffl renderListViewQ^i»*] ListView jtfT#Hi«'l«.

Ait, Android iiWfl WebService WW"Y*.

ft Android XMPP Service ¿fn Web Service I

# ft o Android SDK 1.0 W.ft® * *t £ W t ft API # T it £ ft $ £. Android 1.0 ^ XMPP Service, H5 WebService ft API

JmiJ:Hui^itiiKI^J^i^tilSili, W POST U&Wj A'&mti&n webservicex.net i/j jbj

WebServicc.wcbservicex.net WU-.fcHtti^JA7 t«i«MIR£. M WrlLU/r^^lt WSDL http://www.webservicex.net/WeatherForecast.asmx7WSDLo

2. itse^aiinT

( 1 ) AndroidManifestxml I'JjOAilfl HWf1 ifrftffi

<uses-permission Android:name="Android.permission.INTERNET" />

(2) W HTTP POS T MljjK'Rm (i£j£: SERVER.URL WSDL M UR1., iifl<JURL)o ajfJlWiWinTff^:

private static final String SERVER_URL - "http://www.webservicex.net/WeatherForecast. asmx/GetWeatherByZipCode"; /

HttpPos t request new HttpPost (SERVER URL); — ^ Http

List <NameValuePair> params - new ArrayList <NameValuePair>(); //

params . add (new BasicNameValuePair ( "ZipCode", "200120"));

request. setEntity (new UrlEncodedFormEnt ity (params, HTTP. UTF 8) ) ; //i£BMiSffi try (

HttpResponse httpResponse new DefaultHttpClient() .execute(request); //£ & it# ft & ^

// JRtfiiiBlttrtg if (httpResponse.getStatusLine () .get.StatusCode () ! 404) (

String result = EntityUtils.toString(httpResponse.getEntity()); Log.d(LOG TAG, result);

) catch (Exception e) I Log.e(LOG TAG, e.getMessage()); )

rnmrn:

ill HWMJffl Http kk wcbservicex ftifc ZipCode "200120" (HH WASHINGTON D.C) ifyfa

Ki&HlWrt^inT;

<WeatherForecasts xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlnscxsi "http: //www.w3.org/2001/XMLSchema-instance" xmlns="http://www.webservicex.net"> <Lati tude>38.97571</Latitude> <Longitude>77.02825</Longitude> <AllocationFactor>0.024849</AllocationFactor> <FipsCode>ll</FipsCode> <PlaceName>WASHINGTON</PlaceName> <StateCode>DC</StateCode> <Details>

<WeatherDat.a>

<Day>Saturday, April 25, 2009</Day>

<WeatherImage>http://forecast.weather.gov/images/wtf/set.jpg</WeatherImage> <MaxTemperatureF>8 8</MaxTemperatureF> <MinTemperatureF>57</MinTemperatureF> <MaxTemperatureC>3K/MaxTemperatureC> <MinTemperatureC>34</MinTemperatureC> </WeatherData>

<WeatherData>

<WeatherTrr.age>http: / /forecast. weather . gov/images/wt f / few. jpg</Weather Imaqe> <MaxTemperatureF>89</MaxTemperatureF> <MinTemperatureF>60</MinTemperatureF> <MaxTemperatureC>32</MaxTemperatureC> <MinTemperatureC>16</MinTemperatureC> </WeatherData>

</Details> </WeatherForecasts>

&+m-fm* f $nha. Android 'hjiawmikifx)fr<-as©m&

^ K-km Android + vtMfrfflTtemMtf) SharedPreferences,

\tmlMir-) AfWftffllmmJf-tt. t^HST Android ^WMContentProvider^jS;, itiiriW tiit lR^nwiitiwwf. a^rftiHiiaN^is wcbservice wiiffl. aa**«^^ mn-^mt

«^ffijfeT** f Android J • &) IJ fv. rr +ffi fflm • ft % ffi u fit // A ifc ik r

0 0

Post a comment