开发者

Create add-on system

Many applications in the android market offer a free add-ons like the paid version and after installation, they simply add functiona开发者_如何转开发lity, but is not in the installed programs and does not be in the process. Question: how to implement just such a system add-ons myself .apk, which is something to unlock the application, but it did't install to device (in many cases still download content for playback).


There are a few ways to do this. Essentially, you can stuff all your code in the main apk and then the addon packages tell you what can be accessed. Or you can make the addon apks have actual logic in them. Or a mix of both.

Here's what you can do for starters:

  1. Create a shared ContentProvider. Basically sharing content between 2 apks. You can also register 2 apks to run in the same process and only give privilege to the content provider of apks in the same process or signature.
  2. Define Activities and other components that are only accessible on the addon apk. The main apk will have to detect if the component is callable. You can use the PackageManager's query* methods to do that.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜