How to Run an App That Finds Another Directory?

0

As you can run an app that is not found in data / app but in another folder that will be created by my app where later my app will create the download execution process which will download the .apk "I wonder the .apk it can be run without installing or it must be installed before. " thanks

    
asked by PowerApp 21.11.2016 в 21:38
source

1 answer

1

In short, no, it is impossible to run an apk without installing it.

To install an apk located in a public directory you can use this code:

Intent promptInstall = new Intent(Intent.ACTION_VIEW)
        .setDataAndType(Uri.parse("file:///path/to/your.apk"), 
                "application/vnd.android.package-archive");
startActivity(promptInstall); 

To be able to access a file in a public directory it is necessary that you add this permission to the manifesto:

 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Note The installation of the apk is not 100% automatic, the user will have to explicitly accept the installation of the same. This is so for security reasons

    
answered by 22.11.2016 / 00:10
source