绝对给力 httpclient 4.2.2相关jar包全部都带
2022-03-12 21:08:12 935KB httpclient httpclient4
1
CGlib动态代理类jar包,一共四个jar包,模拟CGlib动态代理用得到。
2022-03-12 20:40:01 365KB cglib jar包 动态代理
1
JNA jar 包,想用JNA 必须在项目中加入这个JAR包
2022-03-12 09:26:08 925KB JNA jar
1
主要介绍了解决idea使用maven编译正常但是运行项目时却提示很多jar包找不到的问题,本文分多种情形给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
1
Netty 开发所需基本jar 包 netty-all-4.1.25.Final.jar netty-all-4.1.25.Final-sources.jar
2022-03-11 18:53:27 5.89MB netty jar
1
从maven中央仓库下载,有需要的自取
2022-03-11 17:51:05 975KB jar包
1
利用flume将mysql的数据同步到kafak,flume是基于CDH6.2.0安装的。解决已下问题:java.lang.NoSuchMethodError:    org.apache.flume.Context.getSubProperties(Ljava/lang/String;)Lcom/google/common/collect/ImmutableMap;
2022-03-11 15:07:58 8.74MB flume kafka mysql cdh
1
jsp-api jar包jsp-api jar包jsp-api jar包
2022-03-11 10:02:05 71KB jsp-api jar包
1
百度地图jar包,除了AR和全位图,其余均可用
2022-03-11 04:15:59 3.18MB 安卓开发 java 百度地图 jar
1
根据网上寻找的资料,加上自己的整合,打包的一个Android多线程下载。可以实现断点下载,暂停继续取消下载,能够显示现在已完成大小,文件大小,完成度,下载速度等。使用方法如下: public class MainActivity extends Activity implements OnClickListener,DownloadListener{ private static final String TAG = "MainActivity"; private static final String SD_PATH = Environment.getExternalStorageDirectory().getPath(); private boolean isPause = false; private MultiThreadDownload multiThreadDownload ; private Button buttonDownload; private Button buttonCancel; private TextProgressBar progressBarTest;//可以使用普通的进度,该进度条是可以显示现在完成度 private TextView textInfo; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);//布局文件就是两个简单的按钮一个用于暂停继续下载,一个用于取消任务,还有一个文本用于显示已完成,文件大小,下载完成度,下载速度等信息以及一个进度条。 //http://d1.apk8.com:8020/game/plantsvszombies2.apk buttonDownload = (Button)findViewById(R.id.buttonDownload); buttonDownload.setText("单击下载"); buttonDownload.setOnClickListener(this); progressBarTest = (TextProgressBar) findViewById(R.id.progressBarTest); textInfo = (TextView) findViewById(R.id.textInfo); buttonCancel = (Button) findViewById(R.id.buttonCancel); buttonCancel.setOnClickListener(this); } @Override public void onClick(View v) { String downloadUrl = "http://dldir1.qq.com/invc/qqpinyin/QQInput4.1_1133(1001).apk"; String savePath = SD_PATH+File.separator+"downloadHelper"+File.separator; String fileName = "QQInput.apk"; switch(v.getId()){ case R.id.buttonDownload: if(!isPause){ multiThreadDownload = new MultiThreadDownload(MainActivity.this,downloadUrl, savePath, fileName, this); multiThreadDownload.start(); buttonDownload.setText("下载..."); isPause = true; }else{ buttonDownload.setText("暂停..."); isPause = false; multiThreadDownload.onPause(); multiThreadDownload = null; } break; case R.id.buttonCancel: if(multiThreadDownload==null){ multiThreadDownload = new MultiThreadDownload(MainActivity.this,downloadUrl, savePath, fileName, this); } Log.d(TAG, ""+multiThreadDownload.isDownload()); if(multiThreadDownload.isDownload()){ multiThreadDownload.onCancel(); isPause = false; } multiThreadDownload = null; break; } } private Handler multiHandler = new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); if(msg.what==1){ Bundle data = msg.getData(); float downloadSpeed = data.getFloat("downloadSpeed"); boolean speedHigh = false; if(downloadSpeed>500){ speedHigh = true; downloadSpeed/=1024; } progressBarTest.setProgress(data.getInt("completedSize")); textInfo.setText(String.format("已完成:%.2fMB", data.getInt("completedSize")/1024f/1024)+"/"+ String.format("总大小:%.2fMB", data.getInt("fileSize")/1024f/1024)+"\n"+ String.format("进度:%.2f%%", data.getBoolean("isCompleted")?100.00:data.getFloat("downloadPercent"))+"/"+ String.format(speedHigh?"速度:%.2fM/S":"速度:%.2fKB/S", downloadSpeed)); if(data.getBoolean("isCompleted")){ buttonDownload.setText("下载完成"); textInfo.setText("下载完成"); } } } }; @Override public void onDownloading(boolean isCompleted,boolean isPause,boolean isCancel,int fileSize,int completedSize,int downloadedSize,float downloadPercent, float downloadSpeed) { Log.d("MainActivity", isCompleted+"||"+isPause+"||"+completedSize+"||"+downloadedSize+"||"+downloadPercent+"||"+downloadSpeed); Message message = Message.obtain(); message.what = 1; Bundle data = new Bundle(); data.putBoolean("isCancel", isCancel); data.putBoolean("isCompleted", isCompleted); data.putInt("fileSize", fileSize); data.putInt("completedSize", completedSize); data.putInt("downloadedSize", downloadedSize); data.putFloat("downloadPercent", downloadPercent); data.putFloat("downloadSpeed", downloadSpeed); message.setData(data); multiHandler.sendMessage(message); } @Override public void onBeforeDownload(boolean isCompleted,boolean isPause,boolean isCancel,int fileSize){ progressBarTest.setMax(fileSize); } @Override public void onAfterDownload(boolean isCompleted,boolean isPause,boolean isCancel,int fileSize){ } @Override public void onPause(boolean isCompelted,boolean isPause,boolean isCancel,int fileSize,int completedSize,int downloadedSize,float downloadPercent,float downloadSpeed){ textInfo.setText("暂停..."); Log.d(TAG, "暂停..."); } @Override public void onCancelDownload(){ progressBarTest.setProgress(0); textInfo.setText("下载取消"); buttonDownload.setText("重新下载"); } }
2022-03-10 19:42:52 22KB Android 多线程 下载
1