如何开发具有附加组件的应用程序? [英] How to develop an app that has add-ons?

查看:64
本文介绍了如何开发具有附加组件的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有关于如何开发具有附加组件"的应用程序的大纲或入门书?

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?

有两个主题的基本应用程序.用户应该能够下载针对特定主题的其他应用.

There is the basic app with 2 themes. The user should be able to download another app for a certain theme.

原始应用程序和新下载的应用程序如何对话?

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

您将如何开发原始应用程序以从仅第二个主题应用程序中获取主题信息和图形资产?

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

我的理解是应用程序是完全独立的,所以这就是为什么我不清楚如何实现的原因.

My understanding is that apps are completely separate so this is why I am unclear how to accomplish this.

推荐答案

原始应用程序和新下载的应用程序如何对话?

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?

步骤1:为您的软件包选择一个命名约定.例如,如果您的基本应用程序是com.abc.app,则主题可能是com.abc.app.theme.*.

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.*.

步骤2:当用户需要选择主题时,请使用PackageManagergetInstalledApplications()通过检查其程序包名称来查找主题.

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.

步骤3:当需要使用主题时,请在PackageManager上调用getResourcesForApplication()以获取主题应用程序的Resources,这样您就可以掌握工作了.

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.

这篇关于如何开发具有附加组件的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆