Search code examples
androidapkandroid-install-apk

Is it possible to load and run APK file inside Android Apps programmatically?


in App A, i have UI Box. Is it possible to load App B (APK) then load and run it into the UI Box ?

so, its like run App B with frame from App A.


Solution

  • I would say it is not possible to install another application from one application as android made a sandbox for each application and prevent it from touching to other applications.

    NOTE: you can invoke an android package installer via Intent.

    File apkFullPath = getFileStreamPath("name_of_downloaded_app.apk");
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(apkFullPath), "application/vnd.android.package-archive"); 
    startActivity(intent);
    

    Hope this will help and solve your problem.