新手入门程序,求指点引路,上网获取数据问题 我想做个小软件从指定的网站(网站类似于谷歌天气预报那种网站)上获取字符数据。通过GPRS和WIfi两种方式(软件中可以自行更改)。请问这些都怎么实现呢 ?最好有点简单的列子 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 至于是走GPRS还是wifi和应用没有实质关系的,可以通过HTTP接口获取数据。 能不能在具体点,有什么具体是什么类,或者是类似的小程序的例子,我刚入手android 基本小白 public final static InputStream getStream(String args) { InputStream stream = null; DefaultHttpClient client = new DefaultHttpClient(); HttpGet get = new HttpGet(args); try { HttpResponse response = client.execute(get); if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { HttpEntity entity = response.getEntity(); stream = entity.getContent(); } return stream; } catch (Exception e) { e.printStackTrace(); return stream; } } 可看我的博客http://blog.csdn.net/tangcheng_ok/article/details/6526032 那请问我做好的程序 怎么封装成手机运行的程序呢 ? 还有我用你博客中的demo能获取天气说明我虚拟机网络可用的,但是我用它自带的浏览器怎么打不开网页呢 ? 可用WebView,或者这样:Intent intent = new Intent(); intent.setAction("android.intent.action.VIEW"); Uri content_uri_browsers = Uri.parse("http://isomobile.com"); intent.setData(content_uri_browsers);//包名、要打开的activityintent.setClassName("com.android.browser", "com.android.browser.BrowserActivity"); startActivity(intent); 关于短信分组问题 android XMLpull解析问题 android 添加onclicklistener后就出问题 怎样逐条显示从服务器端返回的数据 Android里面ComponentName这个类没有clone这个方法 如何真正获取本机号码 对onNewIntent使用上的问题,求赐教谢谢! 怎么更新ecplise中其他的安卓版本,现在只有4.4。我想用4.0 android动态注册的广播是不是app关闭就不能接收到了? setCvCameraViewListener(this)里面的this不可用 强制转换为LinearLayout引起崩溃 android监听软键盘问题
InputStream stream = null;
DefaultHttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(args);
try {
HttpResponse response = client.execute(get);
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
HttpEntity entity = response.getEntity();
stream = entity.getContent();
}
return stream;
} catch (Exception e) {
e.printStackTrace();
return stream;
}
} 可看我的博客http://blog.csdn.net/tangcheng_ok/article/details/6526032
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_uri_browsers = Uri.parse("http://isomobile.com");
intent.setData(content_uri_browsers);
//包名、要打开的activity
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);