Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

android - bundle multiple apps in one app

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...