tamicer / fastdownloader Goto Github PK
View Code? Open in Web Editor NEW基于Okhttp, 结合Retrofit,使用Okio ,简化处理I/O操作,加入多种设计模式,实现基于链式的android平台多线程下载利器!
License: Apache License 2.0
基于Okhttp, 结合Retrofit,使用Okio ,简化处理I/O操作,加入多种设计模式,实现基于链式的android平台多线程下载利器!
License: Apache License 2.0
2,github上怎么没有model源码呢?
compile 'com.tamic.fastdownloader:Android-FastDownloader:1.0.3'
Android-FastDownloader 有提供源码吗
RT @Tamicer
你这给的是demo吧 库的源代码没给?
DownloadInit.initDownload(getApplicationContext());
DownloadInit 类找不到,希望完善
DLRunningQueue()构造方法里面有这一句
int normalMax = DLSettings.getInstance(null).getMaxDownloadCount(); 然后在DLSettings的构造方法里面
DOWN_PATH = mContext.getPackageName() + DOWN_PATH;`
mContext必然为空,会报空指针,不是很明白为什么要这么写?
这个是个封装类
大佬,能提供一份架构图吗,有点乱啊
不把代码贴出来 干毛??
为什么不直接在这个项目里把源码顺带一起打包呢 还有一个 你打包arr上传很容易和其他项目的配置引起冲突的 引用了哪些第三方库也没有说明 库里应该保持干净的代码
暂停后,再点击下载,基本都是失败的,已下载的长度大于总长度
兄弟不靠谱啊!!!!!
java.lang.NullPointerException: Attempt to invoke interface method 'com.tamic.rx.fastdown.listener.IUIDownHandler com.tamic.rx.fastdown.listener.IDownloadListener.onHander()' on a null object reference
at com.tamic.rx.fastdown.core.RxDLController.refreshDownloadingInfo(RxDLController.java:118)
at com.tamic.rx.fastdown.core.RxDownloadManager$UIHandler.handleMessage(RxDownloadManager.java:681)
at android.os.Handler.dispatchMessage(Handler.java:102)
看不到代码,这个很尴尬啊。有问题都没法改,怎么用
code:
package eirless.phy.com.downloadtest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.tamic.rx.fastdown.core.Download;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Download.Builder()
.url("https://dl.bintray.com/neglectedbyboss/maven/com/tamic/fastdownloader/Android-FastDownloader/1.0.1/Android-FastDownloader-1.0.1-sources.jar")
.build(this)
.start();
}
}
gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "eirless.phy.com.downloadtest"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:22.2.1'
testCompile 'junit:junit:4.12'
compile 'com.tamic.fastdownloader:Android-FastDownloader:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
}
======================
报错:
03-26 17:59:45.631 28976-28976/eirless.phy.com.downloadtest E/AndroidRuntime: FATAL EXCEPTION: main
Process: eirless.phy.com.downloadtest, PID: 28976
java.lang.RuntimeException: Unable to start activity ComponentInfo{eirless.phy.com.downloadtest/eirless.phy.com.downloadtest.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'com.tamic.rx.fastdown.listener.IUIDownHandler com.tamic.rx.fastdown.listener.IDownloadListener.onHander()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2793)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.tamic.rx.fastdown.listener.IUIDownHandler com.tamic.rx.fastdown.listener.IDownloadListener.onHander()' on a null object reference
at com.tamic.rx.fastdown.core.DLController.updateProgress(DLController.java:173)
at com.tamic.rx.fastdown.core.DLTaskCenter.addTask(DLTaskCenter.java:782)
at com.tamic.rx.fastdown.client.DLNormalClient.start(DLNormalClient.java:77)
at com.tamic.rx.fastdown.core.Download.start(Download.java:208)
at com.tamic.rx.fastdown.core.Download.start(Download.java:193)
at eirless.phy.com.downloadtest.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6910)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
03-26 17:59:45.653 28976-28976/eirless.phy.com.downloadtest I/Process: Sending signal. PID: 28976 SIG: 9
没有发现DownloadInit.initDownload(getApplicationContext())该方法
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.