6

I am developing an android app which uses several third party apps, called by intents, e.g. a third-party calendar, webradio etc. So in order to start these intents correctly, these apps need to be installed. Is it possbile to include those apks in my app so that they are automatically installed as well when my app is setup ? It seems to be quite a bad way to let the user install these apps manually...

Any suggestions ?

Thanks Peter

michafn
  • 61
  • 1
  • 2

1 Answers1

8

Is it possbile to include those apks in my app so that they are automatically installed as well when my app is setup ?

That's probably not a good idea.

For starters, it is probably a copyright violation, unless you have express permission from those developers to bundle this way.

Then, there is the question of whether those developers actually exposed an API that they are expecting you to be using this way, and whether that API is unique to them or is part of a generic system (e.g., ACTION_SEND). Users should be able to install whatever applications they want that fulfill a generic Intent request (e.g., ACTION_SEND) and not be forced to use some application you mandate. And you should not be integrating to applications that do not expose a documented and supported API or otherwise indicate that they are interested in such integration.

Then, there is the question of whether or not those apps can later be updated, if they were not originally installed via some standard distribution service (e.g., Android Market).

Then, there is matter of all of those APK files making your own APK file that much larger, taking up that much more space on the device.

If you can get past all of that, it should be possible. Package the APKs as assets, copy them on first run to external storage, then launch an ACTION_VIEW Intent on them via startActivity() using the right MIME type.

However, again, this is probably not a good idea.

It seems to be quite a bad way to let the user install these apps manually...

Ideally, your application should not depend upon these other applications, so it will not matter much whether the user has them or not. You can detect if they are there via PackageManager and queryIntentActivities(), then use that to determine if you want to disable parts of your app, or guide the user to install the extra applications, etc.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Here's a decent use case: let's say my app depends on the ZXing barcode scanner (http://code.google.com/p/zxing/). They seem to encourage having other apps depend on theirs via Intents (http://code.google.com/p/zxing/wiki/ScanningViaIntent). It would be neat to bundle the scanner together with my app, especially if I suspect the user may not have network connection when they first use it. Do you think this would qualify for bundling, despite the difficulties you describe? – Jan Żankowski Mar 16 '11 at 15:27
  • @Jan Zankowski: IMHO, that is a fine example of why *not* to bundle. The reason ZXing wants Barcode Scanner integrated via APK is precisely so they can update the app. That's why they went to the trouble of giving you the integration JAR with the auto-detect logic and Market support. If you are dead-set against having the user install Barcode Scanner themselves, then at least integrate ZXing directly in your own code, since it is open source, so you don't waste extra space. In the end, though, whether Barcode Scanner can be shipped as you want is a question for ZXing. – CommonsWare Mar 16 '11 at 16:59
  • I have a similar case. I want to avoid coding too much shared code in C# so I was thinking about doing some in C# and the rest in JAVA and have them talk together using intents. Thus it would make sense to bundle the two apk files in one. – slott Jun 22 '12 at 05:28