Hey, I'm stuck on this bit of code.
As far as I can tell the code is correct, but the .apk file is nowhere to be found. I do see the "downloaded!" toast message however. Also, once I have the .apk file, how can I have android use the default(or prompt for default) app to open it(ie. package installer)?
Thanks very much, any help is greatly appreciated!!
B4X:
Case DialogResponse.POSITIVE
Activity.RemoveAllViews
Activity.LoadLayout("Main")
http.Initialize("http", Me)
http.Download("http://blank.com/blank.apk")
End Select
End If
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success == True Then
Dim out As OutputStream
out = File.OpenOutput(File.DirDefaultExternal,"blank.apk",False )
'File.Copy2(http.GetInputStream, out)
File.Copy2(Job.GetInputStream, out)
http.Release
out.Close
ToastMessageShow("Downloaded!", False)
Else
http.Release
ToastMessageShow("Download failed.", False)
End If
End Sub
As far as I can tell the code is correct, but the .apk file is nowhere to be found. I do see the "downloaded!" toast message however. Also, once I have the .apk file, how can I have android use the default(or prompt for default) app to open it(ie. package installer)?
Thanks very much, any help is greatly appreciated!!
Last edited: