R ronell Well-Known Member Licensed User Longtime User Jun 19, 2018 #1 i have this code to install apk but after i change the target sdk = 26 in manifest this code fails( FileUriExposedException error)... is there a sample code using file provider to access apk file in external storage and install? Code: Copy Dim iIntent As Intent iIntent.Initialize(iIntent.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "myapp.apk")) iIntent.SetType("application/vnd.android.package-archive") StartActivity(iIntent) thanks Ronell
i have this code to install apk but after i change the target sdk = 26 in manifest this code fails( FileUriExposedException error)... is there a sample code using file provider to access apk file in external storage and install? Code: Copy Dim iIntent As Intent iIntent.Initialize(iIntent.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "myapp.apk")) iIntent.SetType("application/vnd.android.package-archive") StartActivity(iIntent) thanks Ronell
DonManfred Expert Licensed User Longtime User Jun 19, 2018 #2 - Search the forum. I remember one user published an example of doing this. - Also browse the AppUpdating lib thread. You may find a link there - Read and understand the FileProvider examples/tutorials. Once you understand how it works then it should be easy to adapt your code to use fileProvider. Edit: https://www.b4x.com/android/forum/threads/version-safe-apk-installation.87667/#content Last edited: Jun 19, 2018 Upvote 0
- Search the forum. I remember one user published an example of doing this. - Also browse the AppUpdating lib thread. You may find a link there - Read and understand the FileProvider examples/tutorials. Once you understand how it works then it should be easy to adapt your code to use fileProvider. Edit: https://www.b4x.com/android/forum/threads/version-safe-apk-installation.87667/#content
R ronell Well-Known Member Licensed User Longtime User Jun 19, 2018 #3 not all heroes wear capes thanks for the tutorial link, Upvote 0