10 2011 档案
摘要:前几天看到淘宝的Android客户端,有种促销的功能,当点击促销的时候连接的淘宝促销wap页面,然后点击商品后又跳到程序的商品详情页面,显示商品的详情。这是一种客户端和web的交互行为。在wp7中有个事件private void webBrowser_Navigating(object sender, NavigatingEventArgs e){}这个事件就是当你在触发wap页面的某个导航按钮时(超链接或者其他导航按钮)。会触发该事件。然后获得导航的URL,和参数信息。通过这个事件,可以完美实现客户端和web的交互行为。
阅读全文
摘要: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...
阅读全文