We are storing an update of our APK in internal storage of the device. Following is the path of the location:
/storage/emulated/0/Android/data/package_name/files/APK/app_name.apk
We are able to store the updated apk at the above path. But we are unable to install the APK programmatically using java(Because we don’t want to add REQUEST_INSTALL_PACKAGES permission). We decided to atleast open this path so that user can manually install the apk.
SDK level is 32
We have tried multiple ways to open this path, but only Downloads folder is getting opened.
Uri selectedUri = Uri.parse("/storage/emulated/0/Android/data/package_name/files/APK");
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(selectedUri, "*/*");
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION);
context.startActivity(intent);
Please suggest a proper way to open the directory.