Android 附加库项目?

发布于 2024-12-10 00:53:49 字数 366 浏览 0 评论 0原文

我在 Android 上有一个迷你钢琴应用程序,我想通过可下载的附加组件来扩展它。 例如,我会将三角钢琴的声音集作为单独的可安装包。

我看到一些应用程序有附加组件(例如 NIV 圣经,添加了不同的圣经版本)。 我想知道如何将单独的 apk 插件集成到我的主程序中。我怎样才能访问这些?我需要做什么来集成这些附加组件?等等。

有什么指示吗?

示例

NIV 圣经在市场上有几个附加组件,您可以使用市场下载。看起来这些确实使用了其包中包含的数据。

另外,我知道 Ruboto 使用 ruboto-core 包,其中包含 JRuby 内容,安装一次,并且所有 Ruboto 包都依赖于该包,所以它一定是可能的

I have a mini piano app on android that I would like to extend with downloadable add-ons.
I would for example have the soundset of a grandpiano as a seperate installable package.

I see some apps that have add-ons (like the NIV Bible, that add different bible editions).
I would like to know how I could integrate a seperate apk add-on into my main program. How can I access those? What would I need to do to integrate these add-ons? Etc.

Any pointers?

Examples

The NIV bible has several add-ons in the market that you can download using the market. It looks like these really use the data contained in their packages.

Also, I know that Ruboto uses a ruboto-core package, that contains the JRuby stuff, that gets installed once, and all Ruboto packages rely on that one, so it must be possible

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

煞人兵器 2024-12-17 00:53:49

我发现可以访问其他APK的资源。我不知道它是否仅限于具有相同签名的应用程序,这不是我尝试过的。我确实知道您可以访问其他 apk 的代码,因为这是 ruboto 正在使用它的 ruboto-core 包做的事情。

要从另一个已安装的 APK 访问资源:

//Get the other apk's resources
Resources resources = context.getPackageManager().getResourcesForApplication(
            "package.name.goes.here");

//Then you need to get the ResID
 int resID = resources.getIdentifier(
            "name_goes_here", "string(or other type like raw)", packageName);

//Open stringResource
 String resourceString = resources.getString(resID);

这也适用于原始资源!

I found out that it's possible to access other APK's resources. I don't know if it's limited to apps that have the same signature, that's not something I tried. I do know that you can access other apk's code, since that is wat ruboto is doing with it's ruboto-core package.

To access resources from another installed APK:

//Get the other apk's resources
Resources resources = context.getPackageManager().getResourcesForApplication(
            "package.name.goes.here");

//Then you need to get the ResID
 int resID = resources.getIdentifier(
            "name_goes_here", "string(or other type like raw)", packageName);

//Open stringResource
 String resourceString = resources.getString(resID);

This also work with raw resources!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文