android异步

el/2024/5/23 2:20:19

有2个方案,一是自己写thead + handler 来实现, 另一种是使用AsyncTask。我选择后者


参考文档:

http://blog.csdn.net/mylzc/article/details/6736988

http://blog.csdn.net/mylzc/article/details/6772129


下面连接提供了自己写thread + handler 的完整demo代码

http://masl.cis.gvsu.edu/2010/04/05/android-code-sample-asynchronous-http-connections/


下面连接提到Android Asynchronous HTTPClient的实现和优化

http://itstarting.iteye.com/blog/1231195


Demo:  Grab a URL Source with ProgressDialog and AsyncTask

http://www.androidsnippets.com/grab-a-url-source-with-progressdialog-and-asynctask


AsyncTask的基本概念

http://changkunyang.iteye.com/blog/1112531

http://dyingbleed.iteye.com/blog/1178114

http://blog.csdn.net/furongkang/article/details/6998734





http://www.ngui.cc/el/5277445.html

相关文章

Android 对话框 (AlertDialog ProgressDialog)

http://android.blog.51cto.com/268543/333769

unable to get system library for the project error when import android project to eclips

solution: open "project.properties" file and update "target" version, the sdk version must be already installed to your machine.

Android UI: Listview ListActivity

http://www.vogella.de/articles/AndroidListView/article.html http://chning2010.iteye.com/blog/605588 http://w2davids.wordpress.com/android-listview-with-iconsimages-and-sharks-with-lasers/ http://android.blog.51cto.com/268543/336162

Android webview访问HTTPS web page如何忽略验证

当使用webview访问ssl加密的url时,页面显示是空白的,而使用系统自带的浏览器打开时,会弹出确认证书的对话框。忽略这步的方法是: WebView myWebView (WebView) findViewById(R.id.webview);myWebView.loadUrl("https://cap.…

Android app里如何共享object

有时你希望在你的app里对一些创建好的object进行共享,例如httpClient object, login flag variable。 你当然可以用static or Singleton pattern来实现共享,但最好的方法就是创建一个custom Application class,然后把你要共享的object放在这个…

Android: HttpClient与Webview共享cookies

httpclient与webview需要进行cookie 共享,因为如果不共享,那么假设你在httpclient进行了登录,然后用webview里打开那些login之后才能看的page,就会叫你再login DefaultHttpClient httpclient....; String toUrl"https://cap.…

iOS: 如何调试程序

2种方法: 方法1:使用NSLog,相当于system.out.println,运行时输出信息会出现在console里 http://xubenyang.me/413 http://xubenyang.me/416 不过要注意:NSLog是很耗系统资源的,因此我们必须保证在debug …

iOS: NSUrlConnection SSL, Http connection frameworks

java有一个httpclient open source lib来进行http connection操作,android就是使用它 iOS自身是通过NSUrlConnection来进行http connection。另外也有一些open source的http connection frameworks: 1. ASIHttpRequest (http://allseeing-i.com/ASIHTTPRequest/) 这…

iOS: Convert NSData to NSString

NSString* str [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

Android/iOS Notification feature

notification有3种方案: 轮询 (poll) 长连接 (socket or http: comet) push notification (c2dm for android, apple notification server for iPhone, 2者的原理是一样的:push server -> apn -> iPhone -> app install…