摘要: 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。 阅读(13836) 评论(0) 推荐(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。 阅读(2496) 评论(0) 推荐(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。 阅读(735) 评论(1) 推荐(0) 编辑
摘要: 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。 阅读(2008) 评论(8) 推荐(1) 编辑
摘要: 前几天做项目用到, 代码贴给大家。/// <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。 阅读(2571) 评论(16) 推荐(3) 编辑
摘要: //模拟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。 阅读(2019) 评论(2) 推荐(1) 编辑