Comments (3)
{"versionCode":2,"versionName":"1.4.12","content":"1.优化功能#2.增加功能","minSupport":1,"url":"http://47.97.213.223:8080/services/download/testDownload/app.apk"}
from appupdate.
这个请求返回为-1 ,在6.0 版本里,大师有解决办法没?
string mDownLoadUrl ="http://47.97.213.223:8080/services/download/testDownload/yn.apk";
URL url = new URL(mDownLoadUrl);
connection = (HttpURLConnection) url.openConnection();
connection.setConnectTimeout(5000); //
connection.setReadTimeout(5000);
connection.setRequestProperty("Connection", "Keep-Alive");
// connection.setRequestProperty("Keep-Alive", "header");
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept-Encoding", "identity");
connection.connect();
int fileLength = connection.getContentLength();
Log.i(TAG,"文件大小为:"+fileLength+"btye");
from appupdate.
已经解决,在服务器中设置response.setContentLength(
);
String fullPath = "E:/" + id +".rmvb";
File downloadFile = new File(fullPath);
response.setContentLength((int) downloadFile.length());
客户端增加
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept-Encoding", "identity");
connection.connect();
from appupdate.
Related Issues (15)
- 当app退出后,后台运行的下载是不是就关闭了?我看您用的是bindservice HOT 1
- 升级的提示框被新的Activity拦住了。 HOT 5
- Could not get resource error
- I want to update the app but Login page should not popup again HOT 1
- 下载过程中点击取消更新出错 HOT 3
- 下载过程中,停止下载和后台下载,问题?
- 下载过程中,按返回键的问题? HOT 1
- 可否直接用HttpURLConnection写下载等逻辑,从而不必引入okhttp? HOT 2
- 有问题
- release版本提示下载出错,dev版本正常,是否和混淆有关? HOT 1
- Override String Values HOT 2
- 下载失败进度条不消失 HOT 3
- 4.4机器上不能正确检测版本,提示已是最新版 HOT 7
- 不能取消 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appupdate.