Android install apk programmatically

15,540

Solution 1

solution in this link

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")),"application/vnd.android.package-archive");
startActivity(intent);

Solution 2

Let me get this straight, you want to remotely put an app on a large number of phones and have it install itself? I don't think that's possible. If it were, think of the virus possibilities!

I think you can email the APK to the phones and have the user use something like Apps-Installer to install it, but I've heard of problems with that method. For your situation though, I would recommend trying it.

The only other alternative I can see beside putting them in the market would be to manually collect all the phones you want it on and manually put it on each one with the ADB, but that would be a huge pain.

Share:
15,540

Related videos on Youtube

Felix
Author by

Felix

Software Engineer enjoy web, phone and desktop development.

Updated on May 17, 2022

Comments

  • Felix
    Felix almost 2 years

    Is it possible to install an apk programmatically in the background or does the user have to accept the installation.

    My scenario is that I want my employees to all have the same set of applications installed.

    Of course they can install applications by them self, but I want them all to have at least some applications installed.

    I'm not talking about installing applications from the market.

  • Felix
    Felix over 13 years
    What? Isn't this just for the debugger?
  • John
    John over 13 years
    I think Felix is try to get the APK to install automatically.
  • sandalone
    sandalone over 13 years
    Or you can hire someone to make installer app for your employees. It would automatically install predefined apps. However, users would get infos which apps are going to be installed.
  • Håvard Geithus
    Håvard Geithus almost 12 years
    Android allows for both installing and uninstalling APKs using intents: stackoverflow.com/questions/6813322/…
  • Swap-IOS-Android
    Swap-IOS-Android about 11 years
    can you give me brief idea How can i update my app without putting it on android market?...i want to update automatically when update is avalible on my site..so app download it and update or reinstall itself..