編輯:關於Android編程
public static File downLoad(String serverPath,String savedPath,ProgressDialog dialog){
try {
URL url=new URL(serverPath);
HttpURLConnection _conn=(HttpURLConnection) url.openConnection();
_conn.setRequestMethod("GET");
_conn.setConnectTimeout(5000);
int code=_conn.getResponseCode();
if(code==200){
//設置進度條的長度
dialog.setMax(_conn.getContentLength());
InputStream is=_conn.getInputStream();
File _file=new File(savedPath);
FileOutputStream _FileOutputStream=new FileOutputStream(_file);
int len=0;
byte[] buffer= new byte[1024];
int _total=0;
while((len=is.read(buffer))!=-1){
_FileOutputStream.write(buffer, 0,len);
_total+=len;
dialog.setProgress(_total);
Thread.sleep(20);
}
_FileOutputStream.flush();
_FileOutputStream.close();
is.close();
return _file;
}else {
return null;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
Android特效之水波紋的實現
前言水波紋特效,想必大家或多或少見過,在我的印象中,大致有如下幾種: 支付寶 咻咻咻 式  
Android 學習之Fragment的創建
本節學習Fragment, Fragment是Android3.0引入的新的API。引入的初衷是為了適合大屏幕的平板電腦。Fragment代表了Activity的子模塊,
iOS/Android 浏覽器(h5)及微信中喚起本地APP
在移動互聯網,鏈接是比較重要的傳播媒質,但很多時候我們又希望用戶能夠回到APP中,這就要求APP可以通過浏覽器或在微信中被方便地喚起。這是一個既直觀又很好的用戶體驗,但在
Android Property Animation
1、概述Android提供了幾種動畫類型:View Animation 、Drawable Animation 、Property Animation 。View An