I have been working on downloading upgrades to my app using the info found here and I have it downloading and when I use the intent to try to install it, I get a Parse Error message stating that There was a problem parsing the package.
If I download it straight from the website it installs fine.
Here is my code. Am I missing something?
If I download it straight from the website it installs fine.
Here is my code. Am I missing something?
B4X:
Sub upgrade
upgradeari.Initialize("upgradeari", Me)
upgradeari.Download("http://www.mysite.com/upgrade/myapp.apk")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "upgradeari"
'print the result to the logs
Log(Job.GetString)
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirInternalCache, "myapp.apk"))
i.SetType("application/vnd.android.package-archive")
StartActivity(i)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub