I am trying to install an APK I included in the file assets, but I am having trouble.
This is my code:
It keeps giving me a parse error or a file corrupt error. However, if I move the apk to the storage area manually and run it, it works fine. Suggestions?
This is my code:
B4X:
Sub InstallLock()
Dim uri As String
uri = "file://" & File.Combine(File.DirRootExternal, "lock.apk")
File.Copy(File.DirAssets,"lock.apk",File.DirRootExternal,"lock.apk")
i2.Initialize(i2.ACTION_VIEW, uri)
i2.SetType("application/vnd.android.package-archive")
StartActivity(i2)
'Msgbox(uri, "")
End Sub
It keeps giving me a parse error or a file corrupt error. However, if I move the apk to the storage area manually and run it, it works fine. Suggestions?