7

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.

John
  • 15,418
  • 12
  • 44
  • 65
Felix
  • 3,246
  • 4
  • 23
  • 25

5 Answers5

11

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);
Community
  • 1
  • 1
Andrew Chen
  • 358
  • 3
  • 7
  • 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.. – Swap-IOS-Android Feb 13 '13 at 12:36
1

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.

John
  • 15,418
  • 12
  • 44
  • 65
  • Well sort of but no exactly, the phones are going to have an application installed on 'em; say an application called ApplicationInstaller. This application will be looking at a database (remote) to see if there is a new application to install. If there is a new application to instsall, the ApplicationInstaller will install the application programmatically. That is the idea. – Felix Jan 22 '11 at 18:22
  • 1
    @Felix: I think that's possible, just not without the users permission explicitly granted for every app. – John Jan 22 '11 at 18:23
  • Yes I hope so. It will def. be and exciting system to build (I have most of the parts down, except for installing the app) – Felix Jan 22 '11 at 18:33
  • 1
    @Felix: Look up Aptoide. It's an open source app installer. Maybe their code can give you what you need. – John Jan 22 '11 at 18:42
  • @John Don't mention about ethics, please. This place is for techniques. Technically, technically -- I'm tired of that phrase when asking new questions myself. Sorry if I misunderstood. –  May 27 '12 at 15:31
  • Downvoted because this is the exact problem that enterprises face. It would be silly to publish an internal Android application to the app store yet one would need a way to blast it out to company owned phones. – Natalie Adams Aug 23 '13 at 22:06
  • @NathanAdams No, it's not the exact problem. Companies can distribute their apps and have their employees install them themselves. They don't have to have the app install itself – John Aug 23 '13 at 22:13
  • http://www.42gears.com/blog/2012/03/how-to-install-android-applicationapk-on-devices-remotely/ - "In an enterprise with multiple deployed mobile devices, a common problem faced by IT administrators is to install an apk file on large number of devices manually." Enterprise isn't about installing on one device but hundreds. Do you think it's a better idea to install applications manually on hundreds of devices? This is exactly what SCCM does for Windows, Puppet does for Linux, Casper for Mac. – Natalie Adams Aug 23 '13 at 22:22
  • @NathanAdams I was talking about having the employees install the apps themselves...one person, one app. Not a big deal. – John Aug 23 '13 at 22:42
0
adb install <apk name>

using above statement we can install apk into devices.For more information install apk

Pinki
  • 21,723
  • 16
  • 55
  • 88
0

Some more requirements would be useful. Is the user required to have these apps? Do you want the apps to be updatable through the market? here's my thoughts in lieu of that information ...

The problem with not going through the market is that they won't get update notices and won't see those apps in the "my apps" list in the market. i'd rethink that ... It's probably not what the user wants, unless you are installing for example enterprise apps that aren't on the market anyway.

You could for example create a "recommended apps" app. It can show your list of apps, and indicate which are installed, and link to the market install page. This of course doesn't force them to have the app installed, but this is actually a friendlier thing to do.

There's also nothing stopping you from creating your own market app. The tools are all there in the SDK. Personally, I'd hate this as a user and would prefer the lighter weight integration on top of the existing market I mentioned above.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
  • Well the apps should never be in the market since they are business specific to my company. The apps could be; a sort of CRM-app and a timemangement-app. So the option of going through the market is not an option. Update notice's and so forth will be a different challenge. For now I need to be able to intall the apps remote. – Felix Jan 22 '11 at 17:39
0

It's a huge security concern and I do not think that Android allows that!

At least, I would not allow any util or service to install any app without informing me.

The best way would be console installation using command adb install <apk name>. You can have APKs in a remote server and all employees have to install them and send you the console output.

sandalone
  • 41,141
  • 63
  • 222
  • 338
  • 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. – sandalone Jan 22 '11 at 17:49
  • Android allows for both installing and uninstalling APKs using intents: http://stackoverflow.com/questions/6813322/install-uninstall-apks-programmatically-packagemanager-vs-intents – Håvard Geithus Jul 27 '12 at 18:32