Android的插件库项目

Android的插件库项目

本文介绍了Android的插件库项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android上,我想与下载的附加组件扩展迷你钢琴应用程序。我想例如具有grandpiano作为一个单独的安装包的音色。

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.

我看到一些应用程序有插件(如NIV圣经,即添加不同的圣经版本)。我想知道我可以集成一个单独的APK附加到我的主程序。我怎样才能访问这些?什么我需要做整合这些加载项?等等。

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.

任何指针?

例子

本NIV圣经有几个附加组件在市场上,你可以利用市场下载。它看起来像这些真正使用包含在其包中的数据。

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.

另外,我知道Ruboto使用ruboto芯封装,包含JRuby的东西,那被安装一次,所有Ruboto软件包依赖于那一个,所以它必须能够

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

推荐答案

我发现它可以访问其他APK的资源。我不知道它是否仅限于具有相同签名的应用程序,这不是我试过。我不知道,你可以访问其他的apk code,因为这是笏ruboto是干嘛用它的ruboto-core包。

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.

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

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!

这篇关于Android的插件库项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 07:39