@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_OPEN_DOCUMENT && resultCode == RESULT_OK) if (data != null) Uri uri = data.getData(); Log.d("File Uri", uri.toString()); // Here you got the uri of the selected file // Proceed to install the APK installAPK(uri);
private void installAPK(Uri uri) Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, "application/vnd.android.package-archive"); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); try startActivity(intent); catch (Exception e) Log.e("MainActivity", "Error in opening apk file", e); open file manager and complete midiagapk installation hot
When you tap the APK file, a pop-up may appear saying, "For your security, your phone is not allowed to install unknown apps from this source." Click on that pop-up. Toggle the switch to Allow from this source . Step 3: Completing the Installation This is where the “open file manager” part
To proceed, you must explicitly grant permission to your file manager app. This is where the “open file manager” part becomes essential. This wasn't the pretty, icon-laden interface most people
He pressed Ctrl + Alt + M . The file manager window popped up, a stark grid of white text on a black background. This wasn't the pretty, icon-laden interface most people used; this was the raw directory structure, the guts of the operating system.
Navigate to the folder, where the midiagapk file should be stored. Enable Installation Permissions : Tap on the midiagapk file.