Hi guys,
I follow this tutorial to download apk file from the B4J server into smartphone.
The operation was successful but there was something strange with the downloaded file .
The icon of the apk was not displayed, see the attachment file. And when I double clicked this file, the error
There was a problem parsing the package raised.
If I copied manually the apk to smartphone, the icon from the apk was showed.
Here is the code to copied downloded file
I tried to download that file via browser in smartphone & install it, it was OK.
So the problem seem in download file or copy from Inputstream to Outputstream.
Any idea how to solved this?
I follow this tutorial to download apk file from the B4J server into smartphone.
Download huge files with HttpUtils2
Better to use: https://www.b4x.com/android/forum/threads/simple-progress-http-download.127214/#post-796463 The attached project includes a slightly modified version of HttpUtils2 and a new service named DownloadService. The purpose of DownloadService is to make it simple to download files of...
www.b4x.com
The operation was successful but there was something strange with the downloaded file .
The icon of the apk was not displayed, see the attachment file. And when I double clicked this file, the error
There was a problem parsing the package raised.
If I copied manually the apk to smartphone, the icon from the apk was showed.
Here is the code to copied downloded file
B4X:
Sub dd_Complete(Job As HttpJob)
Log("Job completed: " & Job.Success)
Dim o As OutputStream
o = File.OpenOutput(File.DirDefaultExternal, "Test.apk", False)
File.Copy2(Job.GetInputStream,o)
Job.Release
End Sub
I tried to download that file via browser in smartphone & install it, it was OK.
So the problem seem in download file or copy from Inputstream to Outputstream.
Any idea how to solved this?
Attachments
Last edited: