Hi, I encountered some problems whilst trying to download files from github. I'm implementing auto-update system to my app and could not get the library to download apk. Here's my code
updatebtn.setOnClickListener {
val url = "https://github.com/X1nto/VancedFiles/blob/master/release.apk"
url.download()
.observeOn(AndroidSchedulers.mainThread())
.subscribeBy(
onNext = { progress ->
loadBar.visibility = View.VISIBLE
loadBar.progress = "${progress.downloadSizeStr()}/${progress.totalSizeStr()}".toInt()
},
onComplete = {
val apk = url.file()
val uri = Uri.fromFile(apk)
val intent = Intent(Intent.ACTION_VIEW)
intent.setDataAndType(uri, "application/vnd.android.package-archive")
startActivity(intent)
},
onError = {
checkingTxt.text = "Something went wrong"
}
)
}
But this always returns onError. Am I doing something wrong?
Hi, I encountered some problems whilst trying to download files from github. I'm implementing auto-update system to my app and could not get the library to download apk. Here's my code
But this always returns onError. Am I doing something wrong?