摘要:
public void getXML(String url) throws XmlPullParserException,IOException,URISyntaxException { String xmlString=downloadXML(url); XmlPullParserFactory factory=XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser parser=factory.newPu... 阅读全文
摘要:
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 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
前几天做项目用到, 代码贴给大家。/// <summary> /// 获取当前位置的经纬度 /// </summary> /// <returns></returns> public static double[] GetLocationProperty() { double[] latLong = new double[2]; GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(); watcher.Try... 阅读全文
摘要:
//模拟XNA的框架(凡是在wp7中应用xna的都必须先模拟此类)public class XNAAsyncDispatcher : IApplicationService { private DispatcherTimer frameworkDispatcherTimer; public XNAAsyncDispatcher(TimeSpan dispatchInterval) { this.frameworkDispatcherTimer = new Dispatche... 阅读全文