摘要:public void getXML(String url) throws XmlPullParserException,IOException,URISyntaxException { String xmlString=downloadXML(url); XmlPullParserFactory factory=XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser parser=factory.newPu... 阅读全文
posted @ 2011-10-20 22:31 Sir。 阅读 (13511) 评论 (0) 编辑
摘要:public void bindToListView(List<Forecast_conditions> conditionsList) { //SimpleAdapter simpleAdapter=new SimpleAdapter(this,conditionsList,R.layout.list_item, new String[]{"day_of_week","low","high","icon","condition"},new int[]{R.id.WeekTextVi 阅读全文
posted @ 2011-10-20 22:28 Sir。 阅读 (2130) 评论 (0) 编辑
摘要:public String downloadXML(final String urlStr) { StringBuffer sb=new StringBuffer(); String line=null; BufferedReader buffer=null; try { URL url=new URL(urlStr); HttpURLConnection urlConn=(HttpURLConnection)url.openConnection(); InputStream inputSt... 阅读全文
posted @ 2011-10-20 22:21 Sir。 阅读 (580) 评论 (1) 编辑
摘要:HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(UrlManager.Login()); myRequest.Method = "POST"; myRequest.ContentType = "application/x-www-form-urlencoded"; myRequest.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), myRequest);private v... 阅读全文
posted @ 2011-10-20 14:15 Sir。 阅读 (1828) 评论 (8) 编辑
摘要:前几天做项目用到, 代码贴给大家。/// <summary> /// 获取当前位置的经纬度 /// </summary> /// <returns></returns> public static double[] GetLocationProperty() { double[] latLong = new double[2]; GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(); watcher.Try... 阅读全文
posted @ 2011-10-20 14:10 Sir。 阅读 (2305) 评论 (16) 编辑
摘要://模拟XNA的框架(凡是在wp7中应用xna的都必须先模拟此类)public class XNAAsyncDispatcher : IApplicationService { private DispatcherTimer frameworkDispatcherTimer; public XNAAsyncDispatcher(TimeSpan dispatchInterval) { this.frameworkDispatcherTimer = new Dispatche... 阅读全文
posted @ 2011-10-20 14:07 Sir。 阅读 (1782) 评论 (2) 编辑