How to develop an app that has add-ons?

前端 未结 2 1113
我在风中等你
我在风中等你 2020-12-28 10:20

Is there an outline or primer of how you would develop an app that has \"add-ons\"?

E.g., how to develop some sort of framework for adding \"themes\" to an app?

相关标签:
2条回答
  • 2020-12-28 10:50

    I believe the cleanest design in this case would be to have a single app in Market, and have the themes available on your own server. Then the user could download the app just once from Market, and then apply the themes available on your server.

    However, if you prefer to have them as separate Market entries, you can set the android:sharedUserId flag on the manifest to make all of them run under the same user ID, which will allow you to share files (bitmaps, etc) between them. Remember they all have to be signed with the same certificate.

    What may be confusing to the user is that they will be able to download an add-on before downloading the main app... in which case you'd have to display an error message asking them to download the main app.

    0 讨论(0)
  • 2020-12-28 10:51

    How does the original app and the new downloaded app talk together?

    For a theme, who says they have to talk together?

    How to would you develop the original app to get the theme information and graphic assets from the 2nd theme only app?

    Step #1: Pick a naming convention for your packages. For example, if your base app is com.abc.app, your themes could be com.abc.app.theme.*.

    Step #2: When it comes time for the user to pick a theme, use PackageManager and getInstalledApplications() to find your themes by checking their package names.

    Step #3: When it comes time to use a theme, call getResourcesForApplication() on PackageManager to get the theme application's Resources, so you can get at your stuff.

    I am sure that there are strategies (e.g., the theme is mostly a conveyor, deploying its stuff in a directory on external storage, from which your main app reads the information), but this is the one I'd start with, as it should require the least user intervention.

    0 讨论(0)
提交回复
热议问题